Skip to content

Commit 8567d67

Browse files
committed
Remove unnecessary use of DispatcherServletAutoConfiguration
1 parent 926052c commit 8567d67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
5858
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
5959
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
60-
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
6160
import org.springframework.context.annotation.Bean;
6261
import org.springframework.context.annotation.Configuration;
6362
import org.springframework.web.servlet.DispatcherServlet;
@@ -345,8 +344,9 @@ void runWithReactiveContextAndIndicatorsInParentContextFindsIndicators() {
345344
@Test
346345
void additionalHealthEndpointsPathsTolerateHealthEndpointThatIsNotWebExposed() {
347346
this.contextRunner
348-
.withConfiguration(AutoConfigurations.of(DispatcherServletAutoConfiguration.class,
349-
EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class))
347+
.withConfiguration(
348+
AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class))
349+
.withBean(DispatcherServlet.class)
350350
.withPropertyValues("management.endpoints.web.exposure.exclude=*",
351351
"management.endpoints.cloudfoundry.exposure.include=*", "spring.main.cloud-platform=cloud_foundry")
352352
.run((context) -> {

0 commit comments

Comments
 (0)