Skip to content

Commit 1830dcf

Browse files
committed
Rename AutoConfigurationReportEndpoint to ConditionsEndpoint
This commit further aligns the change to ConditionEvaluationReport by renaming the 'autoconfig' endpoint to 'conditions'. Closes spring-projectsgh-2945
1 parent 1613361 commit 1830dcf

File tree

17 files changed

+52
-51
lines changed

17 files changed

+52
-51
lines changed
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
* @author Andy Wilkinson
4848
* @since 2.0.0
4949
*/
50-
@Endpoint(id = "autoconfig")
51-
public class AutoConfigurationReportEndpoint {
50+
@Endpoint(id = "conditions")
51+
public class ConditionsReportEndpoint {
5252

5353
private final ConditionEvaluationReport conditionEvaluationReport;
5454

55-
public AutoConfigurationReportEndpoint(
55+
public ConditionsReportEndpoint(
5656
ConditionEvaluationReport conditionEvaluationReport) {
5757
this.conditionEvaluationReport = conditionEvaluationReport;
5858
}
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@
2727

2828
/**
2929
* {@link EnableAutoConfiguration Auto-configuration} for the
30-
* {@link AutoConfigurationReportEndpoint}.
30+
* {@link ConditionsReportEndpoint}.
3131
*
3232
* @author Phillip Webb
3333
* @since 2.0.0
3434
*/
3535
@Configuration
36-
public class AutoConfigurationReportEndpointAutoConfiguration {
36+
public class ConditionsReportEndpointAutoConfiguration {
3737

3838
private ConfigurableApplicationContext context;
3939

40-
public AutoConfigurationReportEndpointAutoConfiguration(
40+
public ConditionsReportEndpointAutoConfiguration(
4141
ConfigurableApplicationContext context) {
4242
this.context = context;
4343
}
4444

4545
@Bean
4646
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
4747
@ConditionalOnEnabledEndpoint
48-
public AutoConfigurationReportEndpoint autoConfigurationReportEndpoint() {
49-
return new AutoConfigurationReportEndpoint(
48+
public ConditionsReportEndpoint conditionsReportEndpoint() {
49+
return new ConditionsReportEndpoint(
5050
ConditionEvaluationReport.get(this.context.getBeanFactory()));
5151
}
5252

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfigurat
66
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration,\
77
org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration,\
88
org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration,\
9-
org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpointAutoConfiguration,\
9+
org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration,\
1010
org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration,\
1111
org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration,\
1212
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthIndicatorAutoConfiguration,\
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@
2424
import static org.assertj.core.api.Assertions.assertThat;
2525

2626
/**
27-
* Tests for {@link AutoConfigurationReportEndpointAutoConfiguration}.
27+
* Tests for {@link ConditionsReportEndpointAutoConfiguration}.
2828
*
2929
* @author Phillip Webb
3030
*/
31-
public class AutoConfigurationReportEndpointAutoConfigurationTests {
31+
public class ConditionsReportEndpointAutoConfigurationTests {
3232

3333
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
3434
.withConfiguration(AutoConfigurations
35-
.of(AutoConfigurationReportEndpointAutoConfiguration.class));
35+
.of(ConditionsReportEndpointAutoConfiguration.class));
3636

3737
@Test
3838
public void runShouldHaveEndpointBean() {
3939
this.contextRunner.run((context) -> assertThat(context)
40-
.hasSingleBean(AutoConfigurationReportEndpoint.class));
40+
.hasSingleBean(ConditionsReportEndpoint.class));
4141
}
4242

4343
@Test
4444
public void runWhenEnabledPropertyIsFalseShouldNotHaveEndpointBean()
4545
throws Exception {
46-
this.contextRunner.withPropertyValues("endpoints.autoconfig.enabled:false")
46+
this.contextRunner.withPropertyValues("endpoints.conditions.enabled:false")
4747
.run((context) -> assertThat(context)
48-
.doesNotHaveBean(AutoConfigurationReportEndpoint.class));
48+
.doesNotHaveBean(ConditionsReportEndpoint.class));
4949
}
5050

5151
}
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import org.junit.Test;
2525

26-
import org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpoint.Report;
26+
import org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpoint.Report;
2727
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
2828
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
2929
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -37,19 +37,19 @@
3737
import static org.mockito.Mockito.mock;
3838

3939
/**
40-
* Tests for {@link AutoConfigurationReportEndpoint}.
40+
* Tests for {@link ConditionsReportEndpoint}.
4141
*
4242
* @author Greg Turnquist
4343
* @author Phillip Webb
4444
* @author Andy Wilkinson
4545
*/
46-
public class AutoConfigurationReportEndpointTests {
46+
public class ConditionsReportEndpointTests {
4747

4848
@Test
4949
public void invoke() throws Exception {
5050
new ApplicationContextRunner().withUserConfiguration(Config.class)
5151
.run((context) -> {
52-
Report report = context.getBean(AutoConfigurationReportEndpoint.class)
52+
Report report = context.getBean(ConditionsReportEndpoint.class)
5353
.getEvaluationReport();
5454
assertThat(report.getPositiveMatches()).isEmpty();
5555
assertThat(report.getNegativeMatches()).containsKey("a");
@@ -79,9 +79,9 @@ public void setupAutoConfigurationReport() {
7979
}
8080

8181
@Bean
82-
public AutoConfigurationReportEndpoint endpoint(
82+
public ConditionsReportEndpoint endpoint(
8383
ConditionEvaluationReport report) {
84-
return new AutoConfigurationReportEndpoint(report);
84+
return new ConditionsReportEndpoint(report);
8585
}
8686

8787
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/EndpointAutoConfigurationClasses.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration;
2323
import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration;
24-
import org.springframework.boot.actuate.autoconfigure.condition.AutoConfigurationReportEndpointAutoConfiguration;
24+
import org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration;
2525
import org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration;
2626
import org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration;
2727
import org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration;
@@ -42,7 +42,7 @@ final class EndpointAutoConfigurationClasses {
4242
List<Class<?>> all = new ArrayList<>();
4343
all.add(AuditEventsEndpointAutoConfiguration.class);
4444
all.add(BeansEndpointAutoConfiguration.class);
45-
all.add(AutoConfigurationReportEndpointAutoConfiguration.class);
45+
all.add(ConditionsReportEndpointAutoConfiguration.class);
4646
all.add(ConfigurationPropertiesReportEndpointAutoConfiguration.class);
4747
all.add(ShutdownEndpointAutoConfiguration.class);
4848
all.add(EnvironmentEndpointAutoConfiguration.class);

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JmxEndpointIntegrationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void jmxEndpointsAreExposed() {
5454
this.contextRunner.run((context) -> {
5555
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
5656
checkEndpointMBeans(mBeanServer,
57-
new String[] { "autoconfig", "beans", "configprops", "env", "health",
57+
new String[] { "beans", "conditions", "configprops", "env", "health",
5858
"info", "mappings", "status", "threaddump", "trace" },
5959
new String[] { "shutdown" });
6060
});
@@ -66,7 +66,7 @@ public void jmxEndpointsCanBeDisabled() {
6666
.run((context) -> {
6767
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
6868
checkEndpointMBeans(mBeanServer, new String[0],
69-
new String[] { "autoconfig", "beans", "configprops", "env",
69+
new String[] { "beans", "conditions", "configprops", "env",
7070
"health", "mappings", "shutdown", "threaddump",
7171
"trace" });
7272

@@ -79,7 +79,7 @@ public void singleJmxEndpointCanBeEnabled() {
7979
"endpoints.beans.jmx.enabled=true").run((context) -> {
8080
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
8181
checkEndpointMBeans(mBeanServer, new String[] { "beans" },
82-
new String[] { "autoconfig", "configprops", "env", "health",
82+
new String[] { "conditions", "configprops", "env", "health",
8383
"mappings", "shutdown", "threaddump", "trace" });
8484
});
8585
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public class WebMvcEndpointExposureIntegrationTests {
6464
public void webEndpointsAreDisabledByDefault() {
6565
this.contextRunner.run((context) -> {
6666
MockMvc mvc = MockMvcBuilders.webAppContextSetup(context).build();
67-
assertThat(isExposed(mvc, HttpMethod.GET, "autoconfig")).isFalse();
6867
assertThat(isExposed(mvc, HttpMethod.GET, "beans")).isFalse();
68+
assertThat(isExposed(mvc, HttpMethod.GET, "conditions")).isFalse();
6969
assertThat(isExposed(mvc, HttpMethod.GET, "configprops")).isFalse();
7070
assertThat(isExposed(mvc, HttpMethod.GET, "env")).isFalse();
7171
assertThat(isExposed(mvc, HttpMethod.GET, "health")).isFalse();
@@ -84,8 +84,8 @@ public void webEndpointsCanBeEnabled() {
8484
.withPropertyValues("endpoints.default.web.enabled=true");
8585
contextRunner.run((context) -> {
8686
MockMvc mvc = MockMvcBuilders.webAppContextSetup(context).build();
87-
assertThat(isExposed(mvc, HttpMethod.GET, "autoconfig")).isTrue();
8887
assertThat(isExposed(mvc, HttpMethod.GET, "beans")).isTrue();
88+
assertThat(isExposed(mvc, HttpMethod.GET, "conditions")).isTrue();
8989
assertThat(isExposed(mvc, HttpMethod.GET, "configprops")).isTrue();
9090
assertThat(isExposed(mvc, HttpMethod.GET, "env")).isTrue();
9191
assertThat(isExposed(mvc, HttpMethod.GET, "health")).isTrue();

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private void logAutoConfigurationReport() {
8989
public void logAutoConfigurationReport(boolean isCrashReport) {
9090
if (this.report == null) {
9191
if (this.applicationContext == null) {
92-
this.logger.info("Unable to provide auto-configuration report "
92+
this.logger.info("Unable to provide the conditions report "
9393
+ "due to missing ApplicationContext");
9494
return;
9595
}
@@ -101,7 +101,7 @@ public void logAutoConfigurationReport(boolean isCrashReport) {
101101
&& !this.logger.isDebugEnabled()) {
102102
this.logger.info(String
103103
.format("%n%nError starting ApplicationContext. To display the "
104-
+ "auto-configuration report re-run your application with "
104+
+ "conditions report re-run your application with "
105105
+ "'debug' enabled."));
106106
}
107107
if (this.logger.isDebugEnabled()) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private StringBuilder getLogMessage(ConditionEvaluationReport report) {
4747
StringBuilder message = new StringBuilder();
4848
message.append(String.format("%n%n%n"));
4949
message.append(String.format("=========================%n"));
50-
message.append(String.format("AUTO-CONFIGURATION REPORT%n"));
50+
message.append(String.format("CONDITIONS REPORT%n"));
5151
message.append(String.format("=========================%n%n%n"));
5252
message.append(String.format("Positive matches:%n"));
5353
message.append(String.format("-----------------%n"));

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void logsDebugOnContextRefresh() {
6464
context.refresh();
6565
withDebugLogging(() -> this.initializer
6666
.onApplicationEvent(new ContextRefreshedEvent(context)));
67-
assertThat(this.outputCapture.toString()).contains("AUTO-CONFIGURATION REPORT");
67+
assertThat(this.outputCapture.toString()).contains("CONDITIONS REPORT");
6868
}
6969

7070
@Test
@@ -81,7 +81,7 @@ public void logsDebugOnError() {
8181
() -> this.initializer.onApplicationEvent(new ApplicationFailedEvent(
8282
new SpringApplication(), new String[0], context, ex)));
8383
}
84-
assertThat(this.outputCapture.toString()).contains("AUTO-CONFIGURATION REPORT");
84+
assertThat(this.outputCapture.toString()).contains("CONDITIONS REPORT");
8585
}
8686

8787
@Test
@@ -98,7 +98,7 @@ public void logsInfoOnErrorIfDebugDisabled() {
9898
new SpringApplication(), new String[0], context, ex));
9999
}
100100
assertThat(this.outputCapture.toString()).contains("Error starting"
101-
+ " ApplicationContext. To display the auto-configuration report re-run"
101+
+ " ApplicationContext. To display the conditions report re-run"
102102
+ " your application with 'debug' enabled.");
103103
}
104104

@@ -141,7 +141,7 @@ public void noErrorIfNotInitialized() throws Exception {
141141
.onApplicationEvent(new ApplicationFailedEvent(new SpringApplication(),
142142
new String[0], null, new RuntimeException("Planned")));
143143
assertThat(this.outputCapture.toString())
144-
.contains("Unable to provide auto-configuration report");
144+
.contains("Unable to provide the conditions report");
145145
}
146146

147147
private void withDebugLogging(Runnable runnable) {

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1077,20 +1077,20 @@ content into your application; rather pick only the properties that you need.
10771077
endpoints.auditevents.web.enabled= # Expose the auditevents endpoint as a Web endpoint.
10781078
endpoints.auditevents.web.path=auditevents # Path of the auditevents endpoint.
10791079
1080-
# AUTO-CONFIGURATION REPORT ENDPOINT ({sc-spring-boot-actuator-autoconfigure}/condition/AutoConfigurationReportEndpoint.{sc-ext}[AutoConfigurationReportEndpoint])
1081-
endpoints.autoconfig.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
1082-
endpoints.autoconfig.enabled= # Enable the autoconfig endpoint.
1083-
endpoints.autoconfig.jmx.enabled= # Expose the autoconfig endpoint as a JMX MBean.
1084-
endpoints.autoconfig.web.enabled= # Expose the autoconfig endpoint as a Web endpoint.
1085-
endpoints.autoconfig.web.path=autoconfig # Path of the autoconfig endpoint.
1086-
10871080
# BEANS ENDPOINT ({sc-spring-boot-actuator}/beans/BeansEndpoint.{sc-ext}[BeansEndpoint])
10881081
endpoints.beans.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
10891082
endpoints.beans.enabled= # Enable the beans endpoint.
10901083
endpoints.beans.jmx.enabled= # Expose the beans endpoint as a JMX MBean.
10911084
endpoints.beans.web.enabled= # Expose the beans endpoint as a Web endpoint.
10921085
endpoints.beans.web.path=beans # Path of the beans endpoint.
10931086
1087+
# CONDITIONS REPORT ENDPOINT ({sc-spring-boot-actuator-autoconfigure}/condition/ConditionsReportEndpoint.{sc-ext}[ConditionsReportEndpoint])
1088+
endpoints.conditions.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
1089+
endpoints.conditions.enabled= # Enable the conditions endpoint.
1090+
endpoints.conditions.jmx.enabled= # Expose the conditions endpoint as a JMX MBean.
1091+
endpoints.conditions.web.enabled= # Expose the conditions endpoint as a Web endpoint.
1092+
endpoints.conditions.web.path=conditions # Path of the conditions endpoint.
1093+
10941094
# CONFIGURATION PROPERTIES REPORT ENDPOINT ({sc-spring-boot-actuator}/context/properties/ConfigurationPropertiesReportEndpoint.{sc-ext}[ConfigurationPropertiesReportEndpoint])
10951095
endpoints.configprops.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
10961096
endpoints.configprops.enabled= # Enable the configprops endpoint.

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
[[auto-configuration-classes]]
33
== Auto-configuration classes
44
Here is a list of all auto-configuration classes provided by Spring Boot, with links to
5-
documentation and source code. Remember to also look at the autoconfig report in your
5+
documentation and source code. Remember to also look at the conditions report in your
66
application for more details of which features are switched on.
77
(To do so, start the app with `--debug` or `-Ddebug` or, in an Actuator application, use
8-
the `autoconfig` endpoint).
8+
the `conditions` endpoint).
99

1010

1111

spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sometimes things fail, and it can be hard to tell why.
5454

5555
There is a really useful `ConditionEvaluationReport` available in any Spring Boot
5656
`ApplicationContext`. You can see it if you enable `DEBUG` logging output. If you use
57-
the `spring-boot-actuator`, there is also an `autoconfig` endpoint that renders the report
57+
the `spring-boot-actuator`, there is also a `conditions` endpoint that renders the report
5858
in JSON. Use that endpoint to debug the application and see what features have been added (and
5959
which not) by Spring Boot at runtime.
6060

@@ -65,7 +65,7 @@ reading the code, remember the following rules of thumb:
6565
`+@Conditional*+` annotations to find out what features they enable and when. Add
6666
`--debug` to the command line or a System property `-Ddebug` to get a log on the
6767
console of all the auto-configuration decisions that were made in your app. In a running
68-
Actuator app, look at the `autoconfig` endpoint (`/application/autoconfig` or the JMX
68+
Actuator app, look at the `conditions` endpoint (`/application/conditions` or the JMX
6969
equivalent) for the same information.
7070
* Look for classes that are `@ConfigurationProperties` (such as
7171
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`])

spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ The following technology-agnostic endpoints are available:
7171
|`auditevents`
7272
|Exposes audit events information for the current application.
7373

74-
|`autoconfig`
75-
|Displays an auto-configuration report showing all auto-configuration candidates and the
76-
reason why they '`were`' or '`were not`' applied.
74+
|`conditions`
75+
|Showing the conditions that were evaluated on configuration and auto-configuration
76+
classes and the reasons why they did or did not match.
7777

7878
|`beans`
7979
|Displays a complete list of all the Spring beans in your application.

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -3319,7 +3319,8 @@ The line in the preceding example passes a value of `true` for the
33193319

33203320
By default, the DDL execution (or validation) is deferred until the `ApplicationContext`
33213321
has started. There is also a `spring.jpa.generate-ddl` flag, but it is not used if
3322-
Hibernate autoconfig is active, because the `ddl-auto` settings are more fine-grained.
3322+
Hibernate auto-configuration is active, because the `ddl-auto` settings are more
3323+
fine-grained.
33233324

33243325

33253326

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/SpringBootDependencyInjectionTestExecutionListenerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void prepareFailingTestInstanceShouldPrintReport() throws Exception {
7474
catch (IllegalStateException ex) {
7575
// Expected
7676
}
77-
this.out.expect(containsString("AUTO-CONFIGURATION REPORT"));
77+
this.out.expect(containsString("CONDITIONS REPORT"));
7878
this.out.expect(containsString("Positive matches"));
7979
this.out.expect(containsString("Negative matches"));
8080
}

0 commit comments

Comments
 (0)