Ejemplo n.º 1
0
 @Test
 public void getUser() {
   service.saveUser(user);
   selectedUser = service.getUserByUserName(user.getUsername());
   assertTrue(user.getUsername().equals(selectedUser.getUsername()));
   assertTrue(user.getPassword().equals(selectedUser.getPassword()));
   assertTrue(user.getIsAdmin() == (selectedUser.getIsAdmin()));
   Boolean userNameAvailable = service.emailAvailable(user.getUsername());
   assertFalse(userNameAvailable);
 }
Ejemplo n.º 2
0
 @Test
 public void resetPassword() {
   String newPassword = service.resetUserPassword(user);
   service.saveUser(user);
   User savedUser = service.getUserByUserName(user.getUsername());
   assertTrue(service.encryptString(newPassword).equals(savedUser.getPassword()));
 }