GrizzlySessionLifecycleListener implements ContainerLifecycleListener { @Override public void onStartup(final Container container) { context.setSessionManager(sessionManager); context.getSessionCookieConfig().setName(sessionName); context.getSessionCookieConfig().setHttpOnly(true); context.getSessionCookieConfig().setSecure(true); context.getSessionCookieConfig().setMaxAge(sessionMaxAge); } @Inject  GrizzlySessionLifecycleListener(
            @Context final ServletContext context,
            final GrizzlySessionManager sessionManager,
            final SystemConfiguration c); @Override void onStartup(final Container container); @Override void onReload(final Container container); @Override void onShutdown(final Container container);  }
@Test public void onStartup() { listener.onStartup(mockContainer); verifyNoMoreInteractions(mockContainer); verify(context, times(1)) .setSessionManager(sessionManager); }
@Test public void onStartupConfigureCookie() { listener.onStartup(mockContainer); verifyNoMoreInteractions(mockContainer); SessionCookieConfig config = context.getSessionCookieConfig(); assertTrue(config.isHttpOnly()); assertTrue(config.isSecure()); assertEquals(config.getMaxAge(), (long) AuthzServerConfig.SESSION_MAX_AGE.getValue()); assertEquals(config.getName(), AuthzServerConfig.SESSION_NAME.getValue()); }