コード例 #1
0
 @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));
 }
コード例 #2
0
 @Test
 public void getUser() throws Exception {
   final long userId = accountService.addUser(testUser);
   assertNotNull(userId);
   final UserProfile createdUser = accountService.getUser(userId);
   assertEquals(testUser, createdUser);
 }
コード例 #3
0
 @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);
 }