|
|
@ -55,6 +55,8 @@ import javax.servlet.FilterChain;
|
|
|
|
import javax.servlet.FilterConfig;
|
|
|
|
import javax.servlet.FilterConfig;
|
|
|
|
import javax.servlet.GenericServlet;
|
|
|
|
import javax.servlet.GenericServlet;
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
|
|
|
|
import javax.servlet.ServletContextEvent;
|
|
|
|
|
|
|
|
import javax.servlet.ServletContextListener;
|
|
|
|
import javax.servlet.ServletException;
|
|
|
|
import javax.servlet.ServletException;
|
|
|
|
import javax.servlet.ServletRequest;
|
|
|
|
import javax.servlet.ServletRequest;
|
|
|
|
import javax.servlet.ServletResponse;
|
|
|
|
import javax.servlet.ServletResponse;
|
|
|
@ -1038,6 +1040,17 @@ public abstract class AbstractServletWebServerFactoryTests {
|
|
|
|
assertThat(servletContext.getSessionCookieConfig().getMaxAge()).isEqualTo(60);
|
|
|
|
assertThat(servletContext.getSessionCookieConfig().getMaxAge()).isEqualTo(60);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void servletContextListenerContextDestroyedIsCalledWhenContainerIsStopped()
|
|
|
|
|
|
|
|
throws Exception {
|
|
|
|
|
|
|
|
ServletContextListener listener = mock(ServletContextListener.class);
|
|
|
|
|
|
|
|
this.webServer = getFactory()
|
|
|
|
|
|
|
|
.getWebServer((servletContext) -> servletContext.addListener(listener));
|
|
|
|
|
|
|
|
this.webServer.start();
|
|
|
|
|
|
|
|
this.webServer.stop();
|
|
|
|
|
|
|
|
verify(listener).contextDestroyed(any(ServletContextEvent.class));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract void addConnector(int port,
|
|
|
|
protected abstract void addConnector(int port,
|
|
|
|
AbstractServletWebServerFactory factory);
|
|
|
|
AbstractServletWebServerFactory factory);
|
|
|
|
|
|
|
|
|
|
|
|