use of edu.hawaii.its.api.type.Group 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);
}
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class HelperServiceTest method setup.
@Before
public void setup() {
new DatabaseSetup(personRepository, groupRepository, groupingRepository, membershipRepository);
admins.add(ADMIN_PERSON);
Group adminGroup = new Group(GROUPING_ADMINS, admins);
personRepository.save(ADMIN_PERSON);
groupRepository.save(adminGroup);
admins.add(APP_PERSON);
Group 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.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class MemberAttributeServiceTest method setup.
@Before
public void setup() {
new DatabaseSetup(personRepository, groupRepository, groupingRepository, membershipRepository);
admins.add(ADMIN_PERSON);
Group adminGroup = new Group(GROUPING_ADMINS, admins);
personRepository.save(ADMIN_PERSON);
groupRepository.save(adminGroup);
admins.add(APP_PERSON);
Group 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.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class MembershipServiceTest method removeSelfOptedTest.
@Test
public void removeSelfOptedTest() {
Group group = groupRepository.findByPath(GROUPING_4_EXCLUDE_PATH);
GroupingsServiceResult gsr;
try {
// member is not in group
gsr = membershipService.removeSelfOpted(GROUPING_4_EXCLUDE_PATH, users.get(5).getUsername());
} catch (GroupingsServiceResultException gsre) {
gsr = gsre.getGsr();
}
assertTrue(gsr.getResultCode().startsWith(FAILURE));
// member is not self-opted
gsr = membershipService.removeSelfOpted(GROUPING_4_EXCLUDE_PATH, users.get(4).getUsername());
assertTrue(gsr.getResultCode().startsWith(SUCCESS));
// make member self-opted
Membership membership = membershipRepository.findByPersonAndGroup(users.get(4), group);
membership.setSelfOpted(true);
membershipRepository.save(membership);
// member is self-opted
gsr = membershipService.removeSelfOpted(GROUPING_4_EXCLUDE_PATH, users.get(4).getUsername());
assertTrue(gsr.getResultCode().startsWith(SUCCESS));
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class MembershipServiceTest 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