Search in sources :

Example 21 with SecurityTeam

use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.

the class SecurityTeamsManagerEntryIntegrationTest method testCreateSecurityTeam.

@Test
public void testCreateSecurityTeam() throws Exception {
    System.out.println(CLASS_NAME + "testCreateSecurityTeam");
    SecurityTeam expected = new SecurityTeam("Name", "Desc");
    SecurityTeam actual = securityTeamsManagerEntry.createSecurityTeam(sess, expected);
    assertNotNull(actual);
    assertEquals(expected, actual);
    actual = securityTeamsManagerEntry.getSecurityTeamById(sess, actual.getId());
    assertNotNull(actual);
    assertEquals(expected, actual);
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 22 with SecurityTeam

use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.

the class SecurityTeamsManagerEntryIntegrationTest method testAddGroupAsAdminSecurityTeamNotExists.

@Test(expected = SecurityTeamNotExistsException.class)
public void testAddGroupAsAdminSecurityTeamNotExists() throws Exception {
    System.out.println(CLASS_NAME + "testAddGroupAsAdminSecurityTeamNotExists");
    setUpUsers();
    Group group = setUpGroup(u0, u1);
    SecurityTeam st = new SecurityTeam(0, "Name", "Desc");
    securityTeamsManagerEntry.addAdmin(sess, st, group);
}
Also used : Group(cz.metacentrum.perun.core.api.Group) SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 23 with SecurityTeam

use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.

the class SecurityTeamsManagerEntryIntegrationTest method testUpdateSecurityTeamWithoutName.

@Test(expected = InternalErrorException.class)
public void testUpdateSecurityTeamWithoutName() throws Exception {
    System.out.println(CLASS_NAME + "testUpdateSecurityTeamWithoutName");
    List<SecurityTeam> teams = setUpSecurityTeams();
    SecurityTeam expected = teams.get(0);
    expected.setName(null);
    securityTeamsManagerEntry.updateSecurityTeam(sess, expected);
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 24 with SecurityTeam

use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.

the class SecurityTeamsManagerEntryIntegrationTest method testUpdateSecurityTeamWithNoName.

@Test(expected = SecurityTeamNotExistsException.class)
public void testUpdateSecurityTeamWithNoName() throws Exception {
    System.out.println(CLASS_NAME + "testUpdateSecurityTeamWithNoName");
    SecurityTeam expected = new SecurityTeam("ToUpdate", "Desc");
    securityTeamsManagerEntry.updateSecurityTeam(sess, expected);
}
Also used : SecurityTeam(cz.metacentrum.perun.core.api.SecurityTeam) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 25 with SecurityTeam

use of cz.metacentrum.perun.core.api.SecurityTeam in project perun by CESNET.

the class SecurityTeamsManagerEntryIntegrationTest method testAddAdminSecurityTeamNotExists.

@Test(expected = SecurityTeamNotExistsException.class)
public void testAddAdminSecurityTeamNotExists() throws Exception {
    System.out.println(CLASS_NAME + "testAddAdminSecurityTeamNotExists");
    setUpUsers();
    SecurityTeam st = new SecurityTeam(0, "Name", "Desc");
    securityTeamsManagerEntry.addAdmin(sess, st, u0);
}
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