Ejemplo n.º 1
0
  @Test
  public void addedUserRoleFoundById() {

    UserRole role = new UserRole("");
    role = userRoleService.save(role);

    assertEquals(role, userRoleService.findById(role.getId()));
  }
Ejemplo n.º 2
0
  @Test
  public void deletedUserNotFoundById() {

    UserRole role = new UserRole("");
    role = userRoleService.save(role);
    userRoleService.delete(role.getId());

    assertNull(userRoleService.findById(role.getId()));
  }
Ejemplo n.º 3
0
  @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);
  }