@Test public void testUserWithWrongPassWord() throws DispatchException { LoginResult result = dispatch.execute(new LoginAction("admin", "i don't know")); assertEquals(result, null); }
@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()); }
@Test public void testLoginWithNotExistUser() throws DispatchException { LoginResult result = dispatch.execute(new LoginAction("unknown", "i don't know")); assertEquals(result, null); }