@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 getUser() throws Exception { final long userId = accountService.addUser(testUser); assertNotNull(userId); final UserProfile createdUser = accountService.getUser(userId); assertEquals(testUser, createdUser); }
@Test public void testUpdateUser() throws Exception { final long userId = accountService.addUser(testUser); accountService.doLogin(TEST_SESSION_ID, testLoginRequest); final UserProfile newProfile = new UserProfile("newLogin", "testpass"); final boolean result = accountService.updateUser(TEST_SESSION_ID, userId, newProfile); assertTrue(result); final UserProfile updatedUser = accountService.getUser(userId); assertEquals(updatedUser, newProfile); }