List of usage examples for javax.servlet SessionCookieConfig isHttpOnly
public boolean isHttpOnly();
From source file:com.thoughtworks.go.server.Jetty9ServerTest.java
@Test public void shouldSetSessionCookieConfig() throws Exception { when(systemEnvironment.isSessionCookieSecure()).thenReturn(true); jetty9Server.configure();/*from w ww . j a v a 2s . co m*/ 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)); }