Search in sources :

Example 26 with SecurityTeam

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

the class SecurityTeamsManagerEntryIntegrationTest method testRemoveAdminSecurityTeamNotExists.

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

Example 27 with SecurityTeam

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

the class SecurityTeamsManagerEntryIntegrationTest method testCreateSecurityTeamWithoutDsc.

@Test
public void testCreateSecurityTeamWithoutDsc() throws Exception {
    System.out.println(CLASS_NAME + "testCreateSecurityTeamWithoutDsc");
    SecurityTeam expected = new SecurityTeam("Name", null);
    SecurityTeam actual = securityTeamsManagerEntry.createSecurityTeam(sess, expected);
    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 28 with SecurityTeam

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

the class SecurityTeamsManagerEntryIntegrationTest method testCreateSecurityTeamAlreadyExists.

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

Example 29 with SecurityTeam

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

the class SecurityTeamsManagerEntryIntegrationTest method testCreateSecurityTeamWithoutName.

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

Example 30 with SecurityTeam

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

the class SecurityTeamsManagerEntryIntegrationTest method testDeleteSecurityTeamBeanNotExists.

@Test(expected = SecurityTeamNotExistsException.class)
public void testDeleteSecurityTeamBeanNotExists() throws Exception {
    System.out.println(CLASS_NAME + "testDeleteSecurityTeamBeanNotExists");
    st0 = new SecurityTeam("Name", "Desc");
    st0.setId(10);
    securityTeamsManagerEntry.deleteSecurityTeam(sess, st0);
}
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