DefaultHttpSessionManager implements HttpSessionManager, SessionCookieConfig { @Override public int getMaxAge() { return maxAge; } DefaultHttpSessionManager(); @Override synchronized HttpSession createSession(HttpServletRequest request); @Override HttpSession getSession(HttpServletRequest request, String currentSessionId); @Override String changeSessionId(HttpServletRequest request); @Override void addListener(T listener); @Override void attributeAdded(HttpSession session, String name, Object value); @Override void attributeReplaced(HttpSession session, String name, Object oldValue, Object newValue); @Override void attributeRemoved(HttpSession session, String name, Object value); @Override synchronized void destroySession(HttpSession session); @Override String encodeRedirectURL(HttpServletResponse response, String url); @Override String encodeURL(HttpServletResponse response, String url); @Override String getComment(); @Override Set<SessionTrackingMode> getDefaultSessionTrackingModes(); @Override String getDomain(); @Override Set<SessionTrackingMode> getEffectiveSessionTrackingModes(); @Override int getMaxAge(); @Override String getName(); @Override String getPath(); @Override SessionCookieConfig getSessionCookieConfig(); @Override int getSessionTimeout(); @Override boolean hasSession(String sessionId); @Override boolean isHttpOnly(); @Override boolean isSecure(); @Override void setComment(String comment); @Override void setDomain(String domain); @Override void setHttpOnly(boolean httpOnly); @Override void setMaxAge(int maxAge); @Override void setName(String name); @Override void setPath(String path); @Override void setSecure(boolean secure); @Override void setSessionTimeout(int sessionTimeout); @Override void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes); @Override void setWebApplication(WebApplication webApplication);  }
@Test void testGetMaxAge() { DefaultWebApplication webApplication = new DefaultWebApplication(); DefaultHttpSessionManager sessionManager = new DefaultHttpSessionManager(); sessionManager.setWebApplication(webApplication); assertEquals(0, sessionManager.getMaxAge()); sessionManager.setMaxAge(60); assertEquals(60, sessionManager.getMaxAge()); }