Ejemplo n.º 1
0
  @Test
  public void delete_resource_user_permission() {
    db.prepareDbUnit(getClass(), "resourceUserPermissions.xml");

    UserRoleDto userRoleToDelete =
        new UserRoleDto().setUserId(200L).setRole(UserRole.USER).setResourceId(1L);

    underTest.deleteUserRole(userRoleToDelete, db.getSession());
    db.getSession().commit();

    db.assertDbUnit(getClass(), "resourceUserPermissions-result.xml", "user_roles");
  }
Ejemplo n.º 2
0
  @Test
  public void delete_global_user_permission() {
    db.prepareDbUnit(getClass(), "globalUserPermissions.xml");

    UserRoleDto userRoleToDelete =
        new UserRoleDto().setUserId(200L).setRole(GlobalPermissions.QUALITY_PROFILE_ADMIN);

    underTest.deleteUserRole(userRoleToDelete, db.getSession());
    db.getSession().commit();

    db.assertDbUnit(getClass(), "globalUserPermissions-result.xml", "user_roles");
  }