@Test public void addingUserRoleIncreasesCount() { long startCount = userRoleService.count(); userRoleService.save(new UserRole("")); long endCount = userRoleService.count(); assertEquals(startCount + 1, endCount); }
@Test public void deletingUserRoleDecreasesCount() { UserRole role = userRoleService.save(new UserRole("")); long startCount = userRoleService.count(); userRoleService.delete(role.getId()); long endCount = userRoleService.count(); assertEquals(startCount - 1, endCount); }