From 1830dcf10309284ef83592f309d90b0a79058ddf Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 14 Nov 2017 14:40:39 +0100 Subject: [PATCH] Rename AutoConfigurationReportEndpoint to ConditionsEndpoint This commit further aligns the change to ConditionEvaluationReport by renaming the 'autoconfig' endpoint to 'conditions'. Closes gh-2945 --- ...Endpoint.java => ConditionsReportEndpoint.java} | 6 +++--- ...ConditionsReportEndpointAutoConfiguration.java} | 10 +++++----- .../src/main/resources/META-INF/spring.factories | 2 +- ...tionsReportEndpointAutoConfigurationTests.java} | 12 ++++++------ ...sts.java => ConditionsReportEndpointTests.java} | 12 ++++++------ .../EndpointAutoConfigurationClasses.java | 4 ++-- .../JmxEndpointIntegrationTests.java | 6 +++--- .../WebMvcEndpointExposureIntegrationTests.java | 4 ++-- .../ConditionEvaluationReportLoggingListener.java | 4 ++-- .../logging/ConditionEvaluationReportMessage.java | 2 +- ...ditionEvaluationReportLoggingListenerTests.java | 8 ++++---- .../asciidoc/appendix-application-properties.adoc | 14 +++++++------- .../appendix-auto-configuration-classes.adoc | 4 ++-- .../spring-boot-docs/src/main/asciidoc/howto.adoc | 4 ++-- .../main/asciidoc/production-ready-features.adoc | 6 +++--- .../src/main/asciidoc/spring-boot-features.adoc | 3 ++- ...endencyInjectionTestExecutionListenerTests.java | 2 +- 17 files changed, 52 insertions(+), 51 deletions(-) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/{AutoConfigurationReportEndpoint.java => ConditionsReportEndpoint.java} (98%) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/{AutoConfigurationReportEndpointAutoConfiguration.java => ConditionsReportEndpointAutoConfiguration.java} (85%) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/{AutoConfigurationReportEndpointAutoConfigurationTests.java => ConditionsReportEndpointAutoConfigurationTests.java} (77%) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/{AutoConfigurationReportEndpointTests.java => ConditionsReportEndpointTests.java} (89%) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpoint.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpoint.java similarity index 98% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpoint.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpoint.java index 9476b4fc1b..6ce9659073 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpoint.java @@ -47,12 +47,12 @@ import org.springframework.util.StringUtils; * @author Andy Wilkinson * @since 2.0.0 */ -@Endpoint(id = "autoconfig") -public class AutoConfigurationReportEndpoint { +@Endpoint(id = "conditions") +public class ConditionsReportEndpoint { private final ConditionEvaluationReport conditionEvaluationReport; - public AutoConfigurationReportEndpoint( + public ConditionsReportEndpoint( ConditionEvaluationReport conditionEvaluationReport) { this.conditionEvaluationReport = conditionEvaluationReport; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfiguration.java similarity index 85% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfiguration.java index 16993f4508..34e7d9c3f0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfiguration.java @@ -27,17 +27,17 @@ import org.springframework.context.annotation.Configuration; /** * {@link EnableAutoConfiguration Auto-configuration} for the - * {@link AutoConfigurationReportEndpoint}. + * {@link ConditionsReportEndpoint}. * * @author Phillip Webb * @since 2.0.0 */ @Configuration -public class AutoConfigurationReportEndpointAutoConfiguration { +public class ConditionsReportEndpointAutoConfiguration { private ConfigurableApplicationContext context; - public AutoConfigurationReportEndpointAutoConfiguration( + public ConditionsReportEndpointAutoConfiguration( ConfigurableApplicationContext context) { this.context = context; } @@ -45,8 +45,8 @@ public class AutoConfigurationReportEndpointAutoConfiguration { @Bean @ConditionalOnMissingBean(search = SearchStrategy.CURRENT) @ConditionalOnEnabledEndpoint - public AutoConfigurationReportEndpoint autoConfigurationReportEndpoint() { - return new AutoConfigurationReportEndpoint( + public ConditionsReportEndpoint conditionsReportEndpoint() { + return new ConditionsReportEndpoint( ConditionEvaluationReport.get(this.context.getBeanFactory())); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories index 9f7c1837e2..f69a690fdc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories @@ -6,7 +6,7 @@ org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfigurat org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration,\ -org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpointAutoConfiguration,\ +org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthIndicatorAutoConfiguration,\ diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfigurationTests.java similarity index 77% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfigurationTests.java index c9c70ec474..95a3eb29c9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfigurationTests.java @@ -24,28 +24,28 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link AutoConfigurationReportEndpointAutoConfiguration}. + * Tests for {@link ConditionsReportEndpointAutoConfiguration}. * * @author Phillip Webb */ -public class AutoConfigurationReportEndpointAutoConfigurationTests { +public class ConditionsReportEndpointAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations - .of(AutoConfigurationReportEndpointAutoConfiguration.class)); + .of(ConditionsReportEndpointAutoConfiguration.class)); @Test public void runShouldHaveEndpointBean() { this.contextRunner.run((context) -> assertThat(context) - .hasSingleBean(AutoConfigurationReportEndpoint.class)); + .hasSingleBean(ConditionsReportEndpoint.class)); } @Test public void runWhenEnabledPropertyIsFalseShouldNotHaveEndpointBean() throws Exception { - this.contextRunner.withPropertyValues("endpoints.autoconfig.enabled:false") + this.contextRunner.withPropertyValues("endpoints.conditions.enabled:false") .run((context) -> assertThat(context) - .doesNotHaveBean(AutoConfigurationReportEndpoint.class)); + .doesNotHaveBean(ConditionsReportEndpoint.class)); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java similarity index 89% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java index a236519015..68eb15802a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/AutoConfigurationReportEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointTests.java @@ -23,7 +23,7 @@ import javax.annotation.PostConstruct; import org.junit.Test; -import org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpoint.Report; +import org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint.Report; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -37,19 +37,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * Tests for {@link AutoConfigurationReportEndpoint}. + * Tests for {@link ConditionsReportEndpoint}. * * @author Greg Turnquist * @author Phillip Webb * @author Andy Wilkinson */ -public class AutoConfigurationReportEndpointTests { +public class ConditionsReportEndpointTests { @Test public void invoke() throws Exception { new ApplicationContextRunner().withUserConfiguration(Config.class) .run((context) -> { - Report report = context.getBean(AutoConfigurationReportEndpoint.class) + Report report = context.getBean(ConditionsReportEndpoint.class) .getEvaluationReport(); assertThat(report.getPositiveMatches()).isEmpty(); assertThat(report.getNegativeMatches()).containsKey("a"); @@ -79,9 +79,9 @@ public class AutoConfigurationReportEndpointTests { } @Bean - public AutoConfigurationReportEndpoint endpoint( + public ConditionsReportEndpoint endpoint( ConditionEvaluationReport report) { - return new AutoConfigurationReportEndpoint(report); + return new ConditionsReportEndpoint(report); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointAutoConfigurationClasses.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointAutoConfigurationClasses.java index 3f1d697e84..65d2a5ea0c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointAutoConfigurationClasses.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointAutoConfigurationClasses.java @@ -21,7 +21,7 @@ import java.util.List; import org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpointAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration; @@ -42,7 +42,7 @@ final class EndpointAutoConfigurationClasses { List> all = new ArrayList<>(); all.add(AuditEventsEndpointAutoConfiguration.class); all.add(BeansEndpointAutoConfiguration.class); - all.add(AutoConfigurationReportEndpointAutoConfiguration.class); + all.add(ConditionsReportEndpointAutoConfiguration.class); all.add(ConfigurationPropertiesReportEndpointAutoConfiguration.class); all.add(ShutdownEndpointAutoConfiguration.class); all.add(EnvironmentEndpointAutoConfiguration.class); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java index 7bfea2bf1e..9a732a0a13 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java @@ -54,7 +54,7 @@ public class JmxEndpointIntegrationTests { this.contextRunner.run((context) -> { MBeanServer mBeanServer = context.getBean(MBeanServer.class); checkEndpointMBeans(mBeanServer, - new String[] { "autoconfig", "beans", "configprops", "env", "health", + new String[] { "beans", "conditions", "configprops", "env", "health", "info", "mappings", "status", "threaddump", "trace" }, new String[] { "shutdown" }); }); @@ -66,7 +66,7 @@ public class JmxEndpointIntegrationTests { .run((context) -> { MBeanServer mBeanServer = context.getBean(MBeanServer.class); checkEndpointMBeans(mBeanServer, new String[0], - new String[] { "autoconfig", "beans", "configprops", "env", + new String[] { "beans", "conditions", "configprops", "env", "health", "mappings", "shutdown", "threaddump", "trace" }); @@ -79,7 +79,7 @@ public class JmxEndpointIntegrationTests { "endpoints.beans.jmx.enabled=true").run((context) -> { MBeanServer mBeanServer = context.getBean(MBeanServer.class); checkEndpointMBeans(mBeanServer, new String[] { "beans" }, - new String[] { "autoconfig", "configprops", "env", "health", + new String[] { "conditions", "configprops", "env", "health", "mappings", "shutdown", "threaddump", "trace" }); }); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java index 5790bd476b..077723972f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java @@ -64,8 +64,8 @@ public class WebMvcEndpointExposureIntegrationTests { public void webEndpointsAreDisabledByDefault() { this.contextRunner.run((context) -> { MockMvc mvc = MockMvcBuilders.webAppContextSetup(context).build(); - assertThat(isExposed(mvc, HttpMethod.GET, "autoconfig")).isFalse(); assertThat(isExposed(mvc, HttpMethod.GET, "beans")).isFalse(); + assertThat(isExposed(mvc, HttpMethod.GET, "conditions")).isFalse(); assertThat(isExposed(mvc, HttpMethod.GET, "configprops")).isFalse(); assertThat(isExposed(mvc, HttpMethod.GET, "env")).isFalse(); assertThat(isExposed(mvc, HttpMethod.GET, "health")).isFalse(); @@ -84,8 +84,8 @@ public class WebMvcEndpointExposureIntegrationTests { .withPropertyValues("endpoints.default.web.enabled=true"); contextRunner.run((context) -> { MockMvc mvc = MockMvcBuilders.webAppContextSetup(context).build(); - assertThat(isExposed(mvc, HttpMethod.GET, "autoconfig")).isTrue(); assertThat(isExposed(mvc, HttpMethod.GET, "beans")).isTrue(); + assertThat(isExposed(mvc, HttpMethod.GET, "conditions")).isTrue(); assertThat(isExposed(mvc, HttpMethod.GET, "configprops")).isTrue(); assertThat(isExposed(mvc, HttpMethod.GET, "env")).isTrue(); assertThat(isExposed(mvc, HttpMethod.GET, "health")).isTrue(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java index 6224978398..b3c01c1adc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java @@ -89,7 +89,7 @@ public class ConditionEvaluationReportLoggingListener public void logAutoConfigurationReport(boolean isCrashReport) { if (this.report == null) { if (this.applicationContext == null) { - this.logger.info("Unable to provide auto-configuration report " + this.logger.info("Unable to provide the conditions report " + "due to missing ApplicationContext"); return; } @@ -101,7 +101,7 @@ public class ConditionEvaluationReportLoggingListener && !this.logger.isDebugEnabled()) { this.logger.info(String .format("%n%nError starting ApplicationContext. To display the " - + "auto-configuration report re-run your application with " + + "conditions report re-run your application with " + "'debug' enabled.")); } if (this.logger.isDebugEnabled()) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java index 1ecb8a922d..2176876839 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java @@ -47,7 +47,7 @@ public class ConditionEvaluationReportMessage { StringBuilder message = new StringBuilder(); message.append(String.format("%n%n%n")); message.append(String.format("=========================%n")); - message.append(String.format("AUTO-CONFIGURATION REPORT%n")); + message.append(String.format("CONDITIONS REPORT%n")); message.append(String.format("=========================%n%n%n")); message.append(String.format("Positive matches:%n")); message.append(String.format("-----------------%n")); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java index cddc4aadfb..f615640705 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java @@ -64,7 +64,7 @@ public class ConditionEvaluationReportLoggingListenerTests { context.refresh(); withDebugLogging(() -> this.initializer .onApplicationEvent(new ContextRefreshedEvent(context))); - assertThat(this.outputCapture.toString()).contains("AUTO-CONFIGURATION REPORT"); + assertThat(this.outputCapture.toString()).contains("CONDITIONS REPORT"); } @Test @@ -81,7 +81,7 @@ public class ConditionEvaluationReportLoggingListenerTests { () -> this.initializer.onApplicationEvent(new ApplicationFailedEvent( new SpringApplication(), new String[0], context, ex))); } - assertThat(this.outputCapture.toString()).contains("AUTO-CONFIGURATION REPORT"); + assertThat(this.outputCapture.toString()).contains("CONDITIONS REPORT"); } @Test @@ -98,7 +98,7 @@ public class ConditionEvaluationReportLoggingListenerTests { new SpringApplication(), new String[0], context, ex)); } assertThat(this.outputCapture.toString()).contains("Error starting" - + " ApplicationContext. To display the auto-configuration report re-run" + + " ApplicationContext. To display the conditions report re-run" + " your application with 'debug' enabled."); } @@ -141,7 +141,7 @@ public class ConditionEvaluationReportLoggingListenerTests { .onApplicationEvent(new ApplicationFailedEvent(new SpringApplication(), new String[0], null, new RuntimeException("Planned"))); assertThat(this.outputCapture.toString()) - .contains("Unable to provide auto-configuration report"); + .contains("Unable to provide the conditions report"); } private void withDebugLogging(Runnable runnable) { diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index c1ed311711..0cc22e2637 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1077,13 +1077,6 @@ content into your application; rather pick only the properties that you need. endpoints.auditevents.web.enabled= # Expose the auditevents endpoint as a Web endpoint. endpoints.auditevents.web.path=auditevents # Path of the auditevents endpoint. - # AUTO-CONFIGURATION REPORT ENDPOINT ({sc-spring-boot-actuator-autoconfigure}/condition/AutoConfigurationReportEndpoint.{sc-ext}[AutoConfigurationReportEndpoint]) - endpoints.autoconfig.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. - endpoints.autoconfig.enabled= # Enable the autoconfig endpoint. - endpoints.autoconfig.jmx.enabled= # Expose the autoconfig endpoint as a JMX MBean. - endpoints.autoconfig.web.enabled= # Expose the autoconfig endpoint as a Web endpoint. - endpoints.autoconfig.web.path=autoconfig # Path of the autoconfig endpoint. - # BEANS ENDPOINT ({sc-spring-boot-actuator}/beans/BeansEndpoint.{sc-ext}[BeansEndpoint]) endpoints.beans.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. endpoints.beans.enabled= # Enable the beans endpoint. @@ -1091,6 +1084,13 @@ content into your application; rather pick only the properties that you need. endpoints.beans.web.enabled= # Expose the beans endpoint as a Web endpoint. endpoints.beans.web.path=beans # Path of the beans endpoint. + # CONDITIONS REPORT ENDPOINT ({sc-spring-boot-actuator-autoconfigure}/condition/ConditionsReportEndpoint.{sc-ext}[ConditionsReportEndpoint]) + endpoints.conditions.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. + endpoints.conditions.enabled= # Enable the conditions endpoint. + endpoints.conditions.jmx.enabled= # Expose the conditions endpoint as a JMX MBean. + endpoints.conditions.web.enabled= # Expose the conditions endpoint as a Web endpoint. + endpoints.conditions.web.path=conditions # Path of the conditions endpoint. + # CONFIGURATION PROPERTIES REPORT ENDPOINT ({sc-spring-boot-actuator}/context/properties/ConfigurationPropertiesReportEndpoint.{sc-ext}[ConfigurationPropertiesReportEndpoint]) endpoints.configprops.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached. endpoints.configprops.enabled= # Enable the configprops endpoint. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc index 70a396131e..bbf1f587d1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc @@ -2,10 +2,10 @@ [[auto-configuration-classes]] == Auto-configuration classes Here is a list of all auto-configuration classes provided by Spring Boot, with links to -documentation and source code. Remember to also look at the autoconfig report in your +documentation and source code. Remember to also look at the conditions report in your application for more details of which features are switched on. (To do so, start the app with `--debug` or `-Ddebug` or, in an Actuator application, use -the `autoconfig` endpoint). +the `conditions` endpoint). diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index bc524093fe..dad0ad080c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -54,7 +54,7 @@ sometimes things fail, and it can be hard to tell why. There is a really useful `ConditionEvaluationReport` available in any Spring Boot `ApplicationContext`. You can see it if you enable `DEBUG` logging output. If you use -the `spring-boot-actuator`, there is also an `autoconfig` endpoint that renders the report +the `spring-boot-actuator`, there is also a `conditions` endpoint that renders the report in JSON. Use that endpoint to debug the application and see what features have been added (and which not) by Spring Boot at runtime. @@ -65,7 +65,7 @@ reading the code, remember the following rules of thumb: `+@Conditional*+` annotations to find out what features they enable and when. Add `--debug` to the command line or a System property `-Ddebug` to get a log on the console of all the auto-configuration decisions that were made in your app. In a running - Actuator app, look at the `autoconfig` endpoint (`/application/autoconfig` or the JMX + Actuator app, look at the `conditions` endpoint (`/application/conditions` or the JMX equivalent) for the same information. * Look for classes that are `@ConfigurationProperties` (such as {sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`]) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index a7406d5d94..f56343921f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -71,9 +71,9 @@ The following technology-agnostic endpoints are available: |`auditevents` |Exposes audit events information for the current application. -|`autoconfig` -|Displays an auto-configuration report showing all auto-configuration candidates and the - reason why they '`were`' or '`were not`' applied. +|`conditions` +|Showing the conditions that were evaluated on configuration and auto-configuration + classes and the reasons why they did or did not match. |`beans` |Displays a complete list of all the Spring beans in your application. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 5dc492f8d6..142e665887 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3319,7 +3319,8 @@ The line in the preceding example passes a value of `true` for the By default, the DDL execution (or validation) is deferred until the `ApplicationContext` has started. There is also a `spring.jpa.generate-ddl` flag, but it is not used if -Hibernate autoconfig is active, because the `ddl-auto` settings are more fine-grained. +Hibernate auto-configuration is active, because the `ddl-auto` settings are more +fine-grained. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerTests.java index f4c2ab9c0b..60eeeb7955 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerTests.java @@ -74,7 +74,7 @@ public class SpringBootDependencyInjectionTestExecutionListenerTests { catch (IllegalStateException ex) { // Expected } - this.out.expect(containsString("AUTO-CONFIGURATION REPORT")); + this.out.expect(containsString("CONDITIONS REPORT")); this.out.expect(containsString("Positive matches")); this.out.expect(containsString("Negative matches")); }