use of org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext in project spring-boot by spring-projects.
the class ServletWebServerFactoryAutoConfigurationTests method contextAlreadyHasDispatcherServlet.
@Test
public void contextAlreadyHasDispatcherServlet() throws Exception {
this.context = new AnnotationConfigServletWebServerApplicationContext(SpringServletConfiguration.class, BaseConfiguration.class);
verifyContext();
assertThat(this.context.getBeanNamesForType(DispatcherServlet.class).length).isEqualTo(2);
}
use of org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext in project spring-boot by spring-projects.
the class ServletWebServerServletContextListenerTests method servletContextListenerBeanIsCalled.
private void servletContextListenerBeanIsCalled(Class<?> configuration) {
AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext(ServletContextListenerBeanConfiguration.class, configuration);
ServletContextListener servletContextListener = context.getBean("servletContextListener", ServletContextListener.class);
verify(servletContextListener).contextInitialized(any(ServletContextEvent.class));
context.close();
}
Aggregations