@Test public void testRemoveUserWrongSessionFail() throws Exception { accountService.addUser(testUser); accountService.doLogin(TEST_SESSION_ID, testLoginRequest); final boolean result = accountService.removeUser(INVALID_SESSION_ID, testUser.getId()); assertFalse(result); }
@Test public void testRemoveUserWrongIdFail() throws Exception { accountService.addUser(testUser); accountService.doLogin(TEST_SESSION_ID, testLoginRequest); final long wrondId = testUser.getId() + 1; final boolean result = accountService.removeUser(TEST_SESSION_ID, wrondId); assertFalse(result); }
@Test public void testRemoveUser() throws Exception { final long userId = accountService.addUser(testUser); assertNotNull(accountService.getUser(userId)); final boolean result = accountService.removeUser(userId); assertTrue(result); assertNull(accountService.getUser(userId)); }
@Test public void testRemoveNoUserFail() throws Exception { final boolean result = accountService.removeUser(testUser.getId()); assertFalse(result); }