diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java index c4f8c8542f..8f3a918ef4 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -64,7 +65,7 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint { /** * Adapts {@link ConditionEvaluationReport} to a JSON friendly structure. */ - @JsonPropertyOrder({ "positiveMatches", "negativeMatches", "exclusions" }) + @JsonPropertyOrder({ "positiveMatches", "negativeMatches", "exclusions", "unconditionalClasses" }) @JsonInclude(Include.NON_EMPTY) public static class Report { @@ -74,12 +75,15 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint { private final List exclusions; + private final Set unconditionalClasses; + private final Report parent; public Report(ConditionEvaluationReport report) { this.positiveMatches = new LinkedMultiValueMap<>(); this.negativeMatches = new LinkedHashMap<>(); this.exclusions = report.getExclusions(); + this.unconditionalClasses = report.getUnconditionalClasses(); for (Map.Entry entry : report .getConditionAndOutcomesBySource().entrySet()) { if (entry.getValue().isFullMatch()) { @@ -119,6 +123,10 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint { return this.exclusions; } + public Set getUnconditionalClasses() { + return this.unconditionalClasses; + } + public Report getParent() { return this.parent; } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpointTests.java index 71221802e2..f4a7c31f64 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpointTests.java @@ -58,6 +58,7 @@ public class AutoConfigurationReportEndpointTests Report report = getEndpointBean().invoke(); assertThat(report.getPositiveMatches()).isEmpty(); assertThat(report.getNegativeMatches()).containsKey("a"); + assertThat(report.getUnconditionalClasses()).contains("b"); assertThat(report.getExclusions()).contains("com.foo.Bar"); } @@ -75,6 +76,7 @@ public class AutoConfigurationReportEndpointTests public void setupAutoConfigurationReport() { ConditionEvaluationReport report = ConditionEvaluationReport .get(this.context.getBeanFactory()); + report.recordEvaluationCandidates(Arrays.asList("a", "b")); report.recordConditionEvaluation("a", mock(Condition.class), mock(ConditionOutcome.class)); report.recordExclusions(Arrays.asList("com.foo.Bar"));