@Test public void testLoginFailed() throws Exception { EasyMock.expect( userDaoMock.findByUsername(EasyMock.<String> anyObject())) .andReturn(null); mockProvider.replayAll(); boolean login = authenticator.login(); Assert.assertFalse(identity.isLoggedIn()); Assert.assertFalse(login); mockProvider.verifyAll(); }
public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; }
Authenticator implements Serializable { public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; } }
Authenticator implements Serializable { public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; }  }
Authenticator implements Serializable { public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; }  boolean login(); boolean logout(); String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password); }
Authenticator implements Serializable { public boolean login() { User user = userDao.findByUsername(username); if (user != null && user.verifyPassword(password)) { identity.setLoggedIn(true); identity.setUser(user); return true; } return false; }  boolean login(); boolean logout(); String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password);  }