Esempio n. 1
0
 @Test
 public void testUserWithWrongPassWord() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("admin", "i don't know"));
   assertEquals(result, null);
 }
Esempio n. 2
0
 @Test
 public void testLoginWithAdmin() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("admin", md5hash("admin")));
   assertEquals(result.getUser().getUserName(), "admin");
   assertEquals(result.getUser().getUserRole(), ADMIN.getRole());
 }
Esempio n. 3
0
 @Test
 public void testLoginWithNotExistUser() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("unknown", "i don't know"));
   assertEquals(result, null);
 }