Search in sources :

Example 26 with ContactGroup

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

the class FacilitiesManagerEntryIntegrationTest method getAllContactGroupNames.

@Test
public void getAllContactGroupNames() throws Exception {
    System.out.println(CLASS_NAME + "getAllContactGroupNames");
    String contactGroupName1 = "testContactGroup01";
    String contactGroupName2 = "testContactGroup02";
    String contactGroupName3 = "testContactGroup03";
    ContactGroup cg1 = new ContactGroup(contactGroupName1, facility);
    ContactGroup cg2 = new ContactGroup(contactGroupName2, facility);
    ContactGroup cg3 = new ContactGroup(contactGroupName3, facility);
    cg1.setOwners(new ArrayList<>(Arrays.asList(owner)));
    cg2.setOwners(new ArrayList<>(Arrays.asList(owner)));
    cg3.setOwners(new ArrayList<>(Arrays.asList(owner)));
    List<ContactGroup> cgs = new ArrayList<>(Arrays.asList(cg1, cg2, cg3));
    facilitiesManagerEntry.addFacilityContacts(sess, cgs);
    List<String> cgnames = facilitiesManagerEntry.getAllContactGroupNames(sess);
    assertTrue(cgnames.contains(contactGroupName1));
    assertTrue(cgnames.contains(contactGroupName2));
    assertTrue(cgnames.contains(contactGroupName3));
}
Also used : ArrayList(java.util.ArrayList) ContactGroup(cz.metacentrum.perun.core.api.ContactGroup) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

ContactGroup (cz.metacentrum.perun.core.api.ContactGroup)26 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)10 Test (org.junit.Test)10 Group (cz.metacentrum.perun.core.api.Group)9 RichUser (cz.metacentrum.perun.core.api.RichUser)9 Member (cz.metacentrum.perun.core.api.Member)8 ArrayList (java.util.ArrayList)8 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)6 Owner (cz.metacentrum.perun.core.api.Owner)5 User (cz.metacentrum.perun.core.api.User)4 RelationExistsException (cz.metacentrum.perun.core.api.exceptions.RelationExistsException)2 AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)1 BanOnFacility (cz.metacentrum.perun.core.api.BanOnFacility)1 Facility (cz.metacentrum.perun.core.api.Facility)1 Host (cz.metacentrum.perun.core.api.Host)1 SecurityTeam (cz.metacentrum.perun.core.api.SecurityTeam)1 BanNotExistsException (cz.metacentrum.perun.core.api.exceptions.BanNotExistsException)1 FacilityContactNotExistsException (cz.metacentrum.perun.core.api.exceptions.FacilityContactNotExistsException)1 OwnerAlreadyRemovedException (cz.metacentrum.perun.core.api.exceptions.OwnerAlreadyRemovedException)1 PrivilegeException (cz.metacentrum.perun.core.api.exceptions.PrivilegeException)1