diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java index 51c76f18ad1..791a30608d6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java @@ -24,6 +24,7 @@ import org.junit.Test; import org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar; import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath; +import org.springframework.boot.autoconfigure.web.servlet.JerseyApplicationPath; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.ApplicationContextRunner; @@ -60,7 +61,7 @@ public class ServletEndpointManagementContextConfigurationTests { } @Test - public void servletPathShouldNotAffectJerseyConfiguration() { + public void contextWhenJerseyShouldContainServletEndpointRegistrar() { FilteredClassLoader classLoader = new FilteredClassLoader( DispatcherServlet.class); this.contextRunner.withClassLoader(classLoader).run((context) -> { @@ -68,7 +69,7 @@ public class ServletEndpointManagementContextConfigurationTests { ServletEndpointRegistrar bean = context .getBean(ServletEndpointRegistrar.class); String basePath = (String) ReflectionTestUtils.getField(bean, "basePath"); - assertThat(basePath).isEqualTo("/actuator"); + assertThat(basePath).isEqualTo("/jersey/actuator"); }); } @@ -94,6 +95,11 @@ public class ServletEndpointManagementContextConfigurationTests { return () -> "/test"; } + @Bean + public JerseyApplicationPath jerseyApplicationPath() { + return () -> "/jersey"; + } + } }