Authenticator implements Serializable { public boolean logout() { log.info("logout current user"); session.invalidate(); return true; }  boolean login(); boolean logout(); String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password);  }
@Test public void testLogout() throws Exception { mockProvider.resetToStrict(httpSessionMock); httpSessionMock.invalidate(); mockProvider.replayAll(); Assert.assertTrue(authenticator.logout()); mockProvider.verifyAll(); }