Skip to content

Commit e387547

Browse files
committed
Move remaining integration tests out of actuator-autoconfigure-all
1 parent 0d5aaea commit e387547

File tree

32 files changed

+251
-479
lines changed

32 files changed

+251
-479
lines changed

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ include "spring-boot-project:spring-boot"
4343
include "spring-boot-project:spring-boot-activemq"
4444
include "spring-boot-project:spring-boot-actuator"
4545
include "spring-boot-project:spring-boot-actuator-autoconfigure"
46-
include "spring-boot-project:spring-boot-actuator-autoconfigure-all"
4746
include "spring-boot-project:spring-boot-actuator-docs"
4847
include "spring-boot-project:spring-boot-actuator-integration-tests"
4948
include "spring-boot-project:spring-boot-amqp"

spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle

Lines changed: 0 additions & 49 deletions
This file was deleted.

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

Lines changed: 0 additions & 61 deletions
This file was deleted.

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

Lines changed: 0 additions & 80 deletions
This file was deleted.

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies {
2424
optional("jakarta.servlet:jakarta.servlet-api")
2525
optional("org.springframework.security:spring-security-config")
2626

27+
testFixturesImplementation(project(":spring-boot-project:spring-boot-test"))
2728
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
2829

2930
testImplementation(project(":spring-boot-project:spring-boot-test"))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.integrationtest;
17+
package org.springframework.boot.actuate.autoconfigure.endpoint.jmx;
1818

1919
import javax.management.MBeanOperationInfo;
2020
import javax.management.MBeanServer;
@@ -23,8 +23,8 @@
2323

2424
import org.junit.jupiter.api.Test;
2525

26+
import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration;
2627
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
27-
import org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration;
2828
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
2929
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;
3030
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
@@ -49,7 +49,7 @@ class JmxEndpointAccessIntegrationTests {
4949
JmxEndpointAutoConfiguration.class, HealthContributorAutoConfiguration.class))
5050
.withUserConfiguration(CustomJmxEndpoint.class)
5151
.withPropertyValues("spring.jmx.enabled=true")
52-
.withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL));
52+
.withConfiguration(AutoConfigurations.of(BeansEndpointAutoConfiguration.class));
5353

5454
@Test
5555
void accessIsUnrestrictedByDefault() {
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.integrationtest;
17+
package org.springframework.boot.actuate.autoconfigure.endpoint.jmx;
1818

1919
import javax.management.InstanceNotFoundException;
2020
import javax.management.IntrospectionException;
@@ -28,9 +28,11 @@
2828

2929
import org.springframework.boot.LazyInitializationBeanFactoryPostProcessor;
3030
import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
31+
import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration;
32+
import org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration;
3133
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
32-
import org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration;
3334
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
35+
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
3436
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository;
3537
import org.springframework.boot.autoconfigure.AutoConfigurations;
3638
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
@@ -54,14 +56,14 @@ class JmxEndpointIntegrationTests {
5456
JmxEndpointAutoConfiguration.class, HealthContributorAutoConfiguration.class))
5557
.withUserConfiguration(HttpExchangeRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class)
5658
.withPropertyValues("spring.jmx.enabled=true")
57-
.withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL));
59+
.withConfiguration(AutoConfigurations.of(HealthEndpointAutoConfiguration.class,
60+
BeansEndpointAutoConfiguration.class, ShutdownEndpointAutoConfiguration.class));
5861

5962
@Test
6063
void jmxEndpointsExposeHealthByDefault() {
6164
this.contextRunner.run((context) -> {
6265
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
63-
checkEndpointMBeans(mBeanServer, new String[] { "health" }, new String[] { "beans", "conditions",
64-
"configprops", "env", "info", "mappings", "threaddump", "httpexchanges", "shutdown" });
66+
checkEndpointMBeans(mBeanServer, new String[] { "health" }, new String[] { "beans", "shutdown" });
6567
});
6668
}
6769

@@ -71,17 +73,15 @@ void jmxEndpointsAreExposedWhenLazyInitializationIsEnabled() {
7173
.withBean(LazyInitializationBeanFactoryPostProcessor.class, LazyInitializationBeanFactoryPostProcessor::new)
7274
.run((context) -> {
7375
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
74-
checkEndpointMBeans(mBeanServer, new String[] { "beans", "conditions", "configprops", "env", "health",
75-
"info", "mappings", "threaddump", "httpexchanges" }, new String[] { "shutdown" });
76+
checkEndpointMBeans(mBeanServer, new String[] { "beans", "health" }, new String[] { "shutdown" });
7677
});
7778
}
7879

7980
@Test
8081
void jmxEndpointsCanBeExcluded() {
8182
this.contextRunner.withPropertyValues("management.endpoints.jmx.exposure.exclude:*").run((context) -> {
8283
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
83-
checkEndpointMBeans(mBeanServer, new String[0], new String[] { "beans", "conditions", "configprops", "env",
84-
"health", "mappings", "shutdown", "threaddump", "httpexchanges" });
84+
checkEndpointMBeans(mBeanServer, new String[0], new String[] { "beans", "health", "shutdown" });
8585

8686
});
8787
}
@@ -90,8 +90,7 @@ void jmxEndpointsCanBeExcluded() {
9090
void singleJmxEndpointCanBeExposed() {
9191
this.contextRunner.withPropertyValues("management.endpoints.jmx.exposure.include=beans").run((context) -> {
9292
MBeanServer mBeanServer = context.getBean(MBeanServer.class);
93-
checkEndpointMBeans(mBeanServer, new String[] { "beans" }, new String[] { "conditions", "configprops",
94-
"env", "health", "mappings", "shutdown", "threaddump", "httpexchanges" });
93+
checkEndpointMBeans(mBeanServer, new String[] { "beans" }, new String[] { "health", "shutdown" });
9594
});
9695
}
9796

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.integrationtest;
17+
package org.springframework.boot.actuate.autoconfigure.endpoint.web;
1818

1919
import org.junit.jupiter.api.Test;
2020

2121
import org.springframework.boot.SpringBootConfiguration;
2222
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
2323
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
2424
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
25-
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
2625
import org.springframework.boot.context.annotation.UserConfigurations;
27-
import org.springframework.boot.data.cassandra.autoconfigure.CassandraDataAutoConfiguration;
28-
import org.springframework.boot.data.rest.autoconfigure.RepositoryRestMvcAutoConfiguration;
2926
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
3027
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
31-
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
3228

3329
import static org.assertj.core.api.Assertions.assertThat;
3430

@@ -46,7 +42,6 @@ void healthEndpointWebExtensionIsAutoConfigured() {
4642
}
4743

4844
@Test
49-
@ClassPathExclusions({ "spring-security-oauth2-client-*.jar", "spring-security-oauth2-resource-server-*.jar" })
5045
void healthEndpointReactiveWebExtensionIsAutoConfigured() {
5146
reactiveWebRunner()
5247
.run((context) -> assertThat(context).hasSingleBean(ReactiveHealthEndpointWebExtension.class));
@@ -64,8 +59,7 @@ private ReactiveWebApplicationContextRunner reactiveWebRunner() {
6459
.withPropertyValues("management.defaults.metrics.export.enabled=false");
6560
}
6661

67-
@EnableAutoConfiguration(exclude = { CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
68-
RepositoryRestMvcAutoConfiguration.class })
62+
@EnableAutoConfiguration
6963
@SpringBootConfiguration
7064
static class WebEndpointTestApplication {
7165

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
* @param <A> the assertions
3838
* @author Madhura Bhave
3939
*/
40-
abstract class AbstractHealthEndpointAdditionalPathIntegrationTests<T extends AbstractApplicationContextRunner<T, C, A>, C extends ConfigurableApplicationContext, A extends ApplicationContextAssertProvider<C>> {
40+
public abstract class AbstractHealthEndpointAdditionalPathIntegrationTests<T extends AbstractApplicationContextRunner<T, C, A>, C extends ConfigurableApplicationContext, A extends ApplicationContextAssertProvider<C>> {
4141

4242
private final T runner;
4343

44-
AbstractHealthEndpointAdditionalPathIntegrationTests(T runner) {
44+
protected AbstractHealthEndpointAdditionalPathIntegrationTests(T runner) {
4545
this.runner = runner;
4646
}
4747

spring-boot-project/spring-boot-actuator-docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
description = "Spring Boot Actuator Docs"
77

88
dependencies {
9-
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
9+
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
1010
testImplementation(project(":spring-boot-project:spring-boot-cache"))
1111
testImplementation(project(":spring-boot-project:spring-boot-flyway"))
1212
testImplementation(project(":spring-boot-project:spring-boot-http-converter"))

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,6 @@ bom {
19771977
"spring-boot-activemq",
19781978
"spring-boot-actuator",
19791979
"spring-boot-actuator-autoconfigure",
1980-
"spring-boot-actuator-autoconfigure-all",
19811980
"spring-boot-all",
19821981
"spring-boot-amqp",
19831982
"spring-boot-artemis",

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ dependencies {
358358
springApplicationExample(platform(project(":spring-boot-project:spring-boot-dependencies")))
359359
springApplicationExample(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
360360

361-
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
361+
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
362362
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
363363

364364
testRuntimeOnly(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))

spring-boot-project/spring-boot-jersey/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies {
3838
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
3939
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-autoconfigure")))
4040
testImplementation("jakarta.servlet:jakarta.servlet-api")
41+
testImplementation("org.springframework:spring-webflux")
4142

4243
testRuntimeOnly("ch.qos.logback:logback-classic")
4344
}

0 commit comments

Comments
 (0)