Search in sources :

Example 6 with SecurityTeam

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"));
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 7 with SecurityTeam

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));
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 8 with SecurityTeam

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;
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam)

Example 9 with SecurityTeam

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;
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam)

Example 10 with SecurityTeam

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());
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

SecurityTeam (cz.metacentrum.perun.core.api.SecurityTeam)37 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)30 Test (org.junit.Test)30 ArrayList (java.util.ArrayList)4 BanOnFacility (cz.metacentrum.perun.core.api.BanOnFacility)3 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)3 AuthzRoles (cz.metacentrum.perun.core.impl.AuthzRoles)3 Facility (cz.metacentrum.perun.core.api.Facility)2 Group (cz.metacentrum.perun.core.api.Group)2 ContactGroup (cz.metacentrum.perun.core.api.ContactGroup)1 Host (cz.metacentrum.perun.core.api.Host)1 User (cz.metacentrum.perun.core.api.User)1 BanNotExistsException (cz.metacentrum.perun.core.api.exceptions.BanNotExistsException)1 PrivilegeException (cz.metacentrum.perun.core.api.exceptions.PrivilegeException)1 RelationExistsException (cz.metacentrum.perun.core.api.exceptions.RelationExistsException)1 SecurityTeamExistsException (cz.metacentrum.perun.core.api.exceptions.SecurityTeamExistsException)1 SecurityTeamNotExistsException (cz.metacentrum.perun.core.api.exceptions.SecurityTeamNotExistsException)1 WrongAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)1 WrongReferenceAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException)1 HashSet (java.util.HashSet)1