/** Test of Read method, of class UserService. */ @Test public void testRead_User() { System.out.println("[UserServiceTest][testRead_User]"); User expected = _svc.Create(UserTestHelper.generateUser()).getResult(); User result = _svc.Read(expected).getResult(); UserTestHelper.assertUser(expected, result); }
/** Test of Update method, of class UserService. */ @Test public void testUpdate() { System.out.println("[UserServiceTest][testUpdate]"); User start = _svc.Create(UserTestHelper.generateUser()).getResult(); start.setFirstName("Updated"); User expected = _svc.Update(start).getResult(); User result = _svc.Read(expected).getResult(); UserTestHelper.assertUser(expected, result); }
/** Test of Delete method, of class UserService. */ @Test public void testDelete_int() { System.out.println("[UserServiceTest][testDelete_int]"); User start = _svc.Create(UserTestHelper.generateUser()).getResult(); assertTrue(_svc.Delete(start.getId()).getResult()); assertEquals(ActionResultStatus.FAILURE, _svc.Read(start).getStatus()); }
/** Test of Create method, of class UserService. */ @Test public void testCreate() { System.out.println("[UserServiceTest][testCreate]"); User u = UserTestHelper.generateUser(); IActionResult<User> result = _svc.Create(u); assertEquals(ActionResultStatus.SUCCESS, result.getStatus()); System.out.println(GsonManager.GO.toJson(u)); }