@Test public void testLogout() { userManager.setUserId("admin"); userManager.setUserPassword("1234"); userManager.login(); assertEquals(UserManager.LOGOUT_PAGE_REDIRECT, userManager.logout()); }
public String logout() { String identifier = userId; LOGGER.debug("invalidating session for '{}'", identifier); FacesContext.getCurrentInstance().getExternalContext() .invalidateSession(); LOGGER.info("logout successful for '{}'", identifier); return LOGOUT_PAGE_REDIRECT; }
UserManager { public String logout() { String identifier = userId; LOGGER.debug("invalidating session for '{}'", identifier); FacesContext.getCurrentInstance().getExternalContext() .invalidateSession(); LOGGER.info("logout successful for '{}'", identifier); return LOGOUT_PAGE_REDIRECT; } }
UserManager { public String logout() { String identifier = userId; LOGGER.debug("invalidating session for '{}'", identifier); FacesContext.getCurrentInstance().getExternalContext() .invalidateSession(); LOGGER.info("logout successful for '{}'", identifier); return LOGOUT_PAGE_REDIRECT; }  }
UserManager { public String logout() { String identifier = userId; LOGGER.debug("invalidating session for '{}'", identifier); FacesContext.getCurrentInstance().getExternalContext() .invalidateSession(); LOGGER.info("logout successful for '{}'", identifier); return LOGOUT_PAGE_REDIRECT; }  String login(); String logout(); boolean isLoggedIn(); String isLoggedInForwardHome(); String getUserId(); void setUserId(String userId); String getUserPassword(); void setUserPassword(String userPassword); User getCurrentUser(); }
UserManager { public String logout() { String identifier = userId; LOGGER.debug("invalidating session for '{}'", identifier); FacesContext.getCurrentInstance().getExternalContext() .invalidateSession(); LOGGER.info("logout successful for '{}'", identifier); return LOGOUT_PAGE_REDIRECT; }  String login(); String logout(); boolean isLoggedIn(); String isLoggedInForwardHome(); String getUserId(); void setUserId(String userId); String getUserPassword(); void setUserPassword(String userPassword); User getCurrentUser(); static final String HOME_PAGE_REDIRECT; static final String LOGOUT_PAGE_REDIRECT; }