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;
}
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]);
}
}
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);
}
}
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[] {}));
}
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);
}
}
Aggregations