Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration of the endpoint this way. It was practically impossible to disable the AgentServlet bean when in a parent context of the management server because of lifecyce issues - you don't know that the user wants a separate management server until too late. This approach also makes it possible to test with spring-test MVC support.
This commit is contained in:
@@ -139,12 +139,13 @@ public class MultipartAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void containerWithAutomatedMultipartTomcatConfiguration() {
|
||||
public void containerWithAutomatedMultipartTomcatConfiguration() throws Exception {
|
||||
this.context = new AnnotationConfigEmbeddedWebApplicationContext(
|
||||
ContainerWithEverythingTomcat.class,
|
||||
EmbeddedServletContainerAutoConfiguration.class,
|
||||
DispatcherServletAutoConfiguration.class,
|
||||
MultipartAutoConfiguration.class);
|
||||
new RestTemplate().getForObject("http://localhost:8080/", String.class);
|
||||
this.context.getBean(MultipartConfigElement.class);
|
||||
assertSame(this.context.getBean(DispatcherServlet.class).getMultipartResolver(),
|
||||
this.context.getBean(StandardServletMultipartResolver.class));
|
||||
|
||||
Reference in New Issue
Block a user