use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.
the class FacilitiesManagerEntryIntegrationTest method assignSecurityTeamSecurityTeamNotExists.
@Test(expected = SecurityTeamNotExistsException.class)
public void assignSecurityTeamSecurityTeamNotExists() throws Exception {
System.out.println(CLASS_NAME + "assignSecurityTeamSecurityTeamNotExists");
// should throw an exception
facilitiesManagerEntry.assignSecurityTeam(sess, facility, new SecurityTeam(0, "name", "dsc"));
}
use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.
the class FacilitiesManagerEntryIntegrationTest method assignSecurityTeam.
@Test
public void assignSecurityTeam() throws Exception {
System.out.println(CLASS_NAME + "assignSecurityTeam");
SecurityTeam st0 = setUpSecurityTeam0();
setUpSecurityTeam1();
facilitiesManagerEntry.assignSecurityTeam(sess, facility, st0);
List<SecurityTeam> actual = facilitiesManagerEntry.getAssignedSecurityTeams(sess, facility);
assertTrue("Facility should have only 1 security team.", actual.size() == 1);
assertTrue("Expected security team is not assigned to facility.", actual.contains(st0));
}
use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.
the class FacilitiesManagerEntryIntegrationTest method setUpSecurityTeam0.
private SecurityTeam setUpSecurityTeam0() throws Exception {
SecurityTeam st = new SecurityTeam("Security0", "Description test 0");
perun.getSecurityTeamsManagerBl().createSecurityTeam(sess, st);
return st;
}
use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.
the class FacilitiesManagerEntryIntegrationTest method setUpSecurityTeam1.
private SecurityTeam setUpSecurityTeam1() throws Exception {
SecurityTeam st = new SecurityTeam("Security1", "Description test 1");
perun.getSecurityTeamsManagerBl().createSecurityTeam(sess, st);
return st;
}
use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.
the class SecurityTeamsManagerEntryIntegrationTest method testDeleteSecurityTeamShouldNotExists.
@Test(expected = SecurityTeamNotExistsException.class)
public void testDeleteSecurityTeamShouldNotExists() throws Exception {
System.out.println(CLASS_NAME + "testDeleteSecurityTeamShouldNotExists");
setUpSecurityTeams();
SecurityTeam actual = securityTeamsManagerEntry.getSecurityTeamById(sess, st0.getId());
assertNotNull(actual);
assertEquals(st0, actual);
securityTeamsManagerEntry.deleteSecurityTeam(sess, st0);
securityTeamsManagerEntry.getSecurityTeamById(sess, st0.getId());
}
Aggregations