Skip to content

Commit 02a1c43

Browse files
committed
Fix tests
1 parent decaacd commit 02a1c43

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar;
2525
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
2626
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
27+
import org.springframework.boot.autoconfigure.web.servlet.JerseyApplicationPath;
2728
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2829
import org.springframework.boot.test.context.FilteredClassLoader;
2930
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
@@ -60,15 +61,15 @@ public void contextShouldContainServletEndpointRegistrar() {
6061
}
6162

6263
@Test
63-
public void servletPathShouldNotAffectJerseyConfiguration() {
64+
public void contextWhenJerseyShouldContainServletEndpointRegistrar() {
6465
FilteredClassLoader classLoader = new FilteredClassLoader(
6566
DispatcherServlet.class);
6667
this.contextRunner.withClassLoader(classLoader).run((context) -> {
6768
assertThat(context).hasSingleBean(ServletEndpointRegistrar.class);
6869
ServletEndpointRegistrar bean = context
6970
.getBean(ServletEndpointRegistrar.class);
7071
String basePath = (String) ReflectionTestUtils.getField(bean, "basePath");
71-
assertThat(basePath).isEqualTo("/actuator");
72+
assertThat(basePath).isEqualTo("/jersey/actuator");
7273
});
7374
}
7475

@@ -94,6 +95,11 @@ public DispatcherServletPath dispatcherServletPath() {
9495
return () -> "/test";
9596
}
9697

98+
@Bean
99+
public JerseyApplicationPath jerseyApplicationPath() {
100+
return () -> "/jersey";
101+
}
102+
97103
}
98104

99105
}

0 commit comments

Comments
 (0)