Search in sources :

Example 16 with Person

use of edu.hawaii.its.api.type.Person in project uhgroupings by uhawaii-system-its-ti-iam.

the class GroupingsRestControllerTest method grouping.

// Test data.
private Grouping grouping() {
    Grouping grouping = new Grouping("test:ing:me:bob");
    Group basisGroup = new Group();
    basisGroup.addMember(new Person("b0-name", "b0-uuid", "b0-username"));
    basisGroup.addMember(new Person("b1-name", "b1-uuid", "b1-username"));
    basisGroup.addMember(new Person("b2-name", "b2-uuid", "b2-username"));
    grouping.setBasis(basisGroup);
    Group exclude = new Group();
    exclude.addMember(new Person("e0-name", "e0-uuid", "e0-username"));
    grouping.setExclude(exclude);
    Group include = new Group();
    include.addMember(new Person("i0-name", "i0-uuid", "i0-username"));
    include.addMember(new Person("i1-name", "i1-uuid", "i1-username"));
    grouping.setInclude(include);
    Group owners = new Group();
    owners.addMember(new Person("o0-name", "o0-uuid", "o0-username"));
    owners.addMember(new Person("o1-name", "o1-uuid", "o1-username"));
    owners.addMember(new Person("o2-name", "o2-uuid", "o2-username"));
    owners.addMember(new Person("o3-name", "o3-uuid", "o3-username"));
    grouping.setOwners(owners);
    grouping.setListservOn(true);
    return grouping;
}
Also used : Group(edu.hawaii.its.api.type.Group) Grouping(edu.hawaii.its.api.type.Grouping) Person(edu.hawaii.its.api.type.Person)

Example 17 with Person

use of edu.hawaii.its.api.type.Person in project uhgroupings by uhawaii-system-its-ti-iam.

the class GroupRepositoryTest method setup.

@Before
public void setup() {
    for (int i = 0; i < 10; i++) {
        persons[i] = new Person("name" + i, "uuid" + i, "username" + i);
        personRepository.save(persons[i]);
    }
    for (int i = 0; i < 5; i++) {
        memberLists.add(new ArrayList<>());
    }
    memberLists.get(1).add(persons[0]);
    memberLists.get(1).add(persons[1]);
    memberLists.get(2).add(persons[2]);
    memberLists.get(2).add(persons[3]);
    memberLists.get(2).add(persons[4]);
    memberLists.get(3).add(persons[5]);
    memberLists.get(3).add(persons[6]);
    memberLists.get(3).add(persons[7]);
    memberLists.get(3).add(persons[8]);
    memberLists.get(4).add(persons[0]);
    memberLists.get(4).add(persons[1]);
    memberLists.get(4).add(persons[2]);
    memberLists.get(4).add(persons[3]);
    memberLists.get(4).add(persons[4]);
    memberLists.get(4).add(persons[5]);
    memberLists.get(4).add(persons[6]);
    memberLists.get(4).add(persons[7]);
    memberLists.get(4).add(persons[8]);
    memberLists.get(4).add(persons[9]);
    for (int i = 0; i < 5; i++) {
        groups[i] = new Group("path:to:group" + i, memberLists.get(i));
        groupRepository.save(groups[i]);
    }
}
Also used : Group(edu.hawaii.its.api.type.Group) Person(edu.hawaii.its.api.type.Person) Before(org.junit.Before)

Example 18 with Person

use of edu.hawaii.its.api.type.Person in project uhgroupings by uhawaii-system-its-ti-iam.

the class GrouperFactoryServiceTest method setup.

@Before
public void setup() {
    new DatabaseSetup(personRepository, groupRepository, groupingRepository, membershipRepository);
    admins.add(ADMIN_PERSON);
    adminGroup = new Group(GROUPING_ADMINS, admins);
    personRepository.save(ADMIN_PERSON);
    groupRepository.save(adminGroup);
    admins.add(APP_PERSON);
    appGroup = new Group(GROUPING_APPS, apps);
    personRepository.save(APP_PERSON);
    groupRepository.save(appGroup);
    for (int i = 0; i < 100; i++) {
        String name = NAME + i;
        String uuid = UUID + i;
        String username = USERNAME + i;
        Person person = new Person(name, uuid, username);
        users.add(person);
        WsSubjectLookup lookup = new WsSubjectLookup(null, null, username);
        lookups.add(lookup);
    }
}
Also used : Group(edu.hawaii.its.api.type.Group) WsSubjectLookup(edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup) Person(edu.hawaii.its.api.type.Person) Before(org.junit.Before)

Example 19 with Person

use of edu.hawaii.its.api.type.Person in project uhgroupings by uhawaii-system-its-ti-iam.

the class GroupingAssignmentServiceTest method makePerson.

@Test
public void makePerson() {
    String name = "name";
    String id = "uuid";
    String identifier = "username";
    String[] attributeNames = new String[] { UID_KEY, UUID_KEY, LAST_NAME_KEY, COMPOSITE_NAME_KEY, FIRST_NAME_KEY };
    String[] attributeValues = new String[] { identifier, id, null, name, null };
    WsSubject subject = new WsSubject();
    subject.setName(name);
    subject.setId(id);
    subject.setAttributeValues(attributeValues);
    Person person = groupingAssignmentService.makePerson(subject, attributeNames);
    assertTrue(person.getName().equals(name));
    assertTrue(person.getUuid().equals(id));
    assertTrue(person.getUsername().equals(identifier));
    assertNotNull(groupingAssignmentService.makePerson(new WsSubject(), new String[] {}));
}
Also used : WsSubject(edu.internet2.middleware.grouperClient.ws.beans.WsSubject) Person(edu.hawaii.its.api.type.Person) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 20 with Person

use of edu.hawaii.its.api.type.Person in project uhgroupings by uhawaii-system-its-ti-iam.

the class GroupingFactoryServiceTest method setup.

@Before
public void setup() {
    new DatabaseSetup(personRepository, groupRepository, groupingRepository, membershipRepository);
    admins.add(ADMIN_PERSON);
    adminGroup = new Group(GROUPING_ADMINS, admins);
    personRepository.save(ADMIN_PERSON);
    groupRepository.save(adminGroup);
    admins.add(APP_PERSON);
    appGroup = new Group(GROUPING_APPS, apps);
    personRepository.save(APP_PERSON);
    groupRepository.save(appGroup);
    for (int i = 0; i < 100; i++) {
        String name = NAME + i;
        String uuid = UUID + i;
        String username = USERNAME + i;
        Person person = new Person(name, uuid, username);
        users.add(person);
        WsSubjectLookup lookup = new WsSubjectLookup(null, null, username);
        lookups.add(lookup);
    }
}
Also used : Group(edu.hawaii.its.api.type.Group) WsSubjectLookup(edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup) Person(edu.hawaii.its.api.type.Person) Before(org.junit.Before)

Aggregations

Person (edu.hawaii.its.api.type.Person)32 Group (edu.hawaii.its.api.type.Group)20 WsGroup (edu.internet2.middleware.grouperClient.ws.beans.WsGroup)9 WsSubjectLookup (edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup)8 Before (org.junit.Before)8 Grouping (edu.hawaii.its.api.type.Grouping)7 ArrayList (java.util.ArrayList)7 WsResultMeta (edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta)6 Test (org.junit.Test)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 Membership (edu.hawaii.its.api.type.Membership)5 GroupingsServiceResult (edu.hawaii.its.api.type.GroupingsServiceResult)3 WsMembership (edu.internet2.middleware.grouperClient.ws.beans.WsMembership)3 WsSubject (edu.internet2.middleware.grouperClient.ws.beans.WsSubject)2 GroupingsServiceResultException (edu.hawaii.its.api.type.GroupingsServiceResultException)1 WsAddMemberResults (edu.internet2.middleware.grouperClient.ws.beans.WsAddMemberResults)1 WsAssignAttributesResults (edu.internet2.middleware.grouperClient.ws.beans.WsAssignAttributesResults)1 WsAssignGrouperPrivilegesLiteResult (edu.internet2.middleware.grouperClient.ws.beans.WsAssignGrouperPrivilegesLiteResult)1 WsDeleteMemberResults (edu.internet2.middleware.grouperClient.ws.beans.WsDeleteMemberResults)1 WsGetGrouperPrivilegesLiteResult (edu.internet2.middleware.grouperClient.ws.beans.WsGetGrouperPrivilegesLiteResult)1