Merge branch '2.0.x'
This commit is contained in:
commit
427d494d57
|
|
@ -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;
|
||||
|
|
@ -58,14 +59,14 @@ public class ServletEndpointManagementContextConfigurationTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void servletPathShouldNotAffectJerseyConfiguration() {
|
||||
public void contextWhenJerseyShouldContainServletEndpointRegistrar() {
|
||||
FilteredClassLoader classLoader = new FilteredClassLoader(
|
||||
DispatcherServlet.class);
|
||||
this.contextRunner.withClassLoader(classLoader).run((context) -> {
|
||||
assertThat(context).hasSingleBean(ServletEndpointRegistrar.class);
|
||||
ServletEndpointRegistrar bean = context
|
||||
.getBean(ServletEndpointRegistrar.class);
|
||||
assertThat(bean).hasFieldOrPropertyWithValue("basePath", "/actuator");
|
||||
assertThat(bean).hasFieldOrPropertyWithValue("basePath", "/jersey/actuator");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +92,11 @@ public class ServletEndpointManagementContextConfigurationTests {
|
|||
return () -> "/test";
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JerseyApplicationPath jerseyApplicationPath() {
|
||||
return () -> "/jersey";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue