List of usage examples for javax.servlet SessionCookieConfig isSecure
public boolean isSecure();
From source file:com.thoughtworks.go.server.Jetty9ServerTest.java
@Test public void shouldSetSessionCookieConfig() throws Exception { when(systemEnvironment.isSessionCookieSecure()).thenReturn(true); jetty9Server.configure();//ww w. j a va 2 s .com jetty9Server.setSessionConfig(); jetty9Server.startHandlers(); WebAppContext webAppContext = (WebAppContext) getLoadedHandlers().get(WebAppContext.class); SessionCookieConfig sessionCookieConfig = webAppContext.getSessionHandler().getSessionCookieConfig(); assertThat(sessionCookieConfig.isHttpOnly(), is(true)); assertThat(sessionCookieConfig.isSecure(), is(true)); assertThat(sessionCookieConfig.getMaxAge(), is(5678)); when(systemEnvironment.isSessionCookieSecure()).thenReturn(false); jetty9Server.setSessionConfig(); assertThat(sessionCookieConfig.isSecure(), is(false)); }