use of edu.hawaii.its.api.type.GroupingAssignment in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestGroupingsRestController method groupingAssignmentTest.
@Test
@WithMockUhUser(username = "iamtst01")
public void groupingAssignmentTest() throws Exception {
GroupingAssignment groupings = mapGroupingAssignment();
boolean inGrouping = false;
for (Grouping grouping : groupings.getGroupingsIn()) {
if (grouping.getPath().contains(this.GROUPING)) {
inGrouping = true;
break;
}
}
assertTrue(inGrouping);
boolean canOptin = false;
for (Grouping grouping : groupings.getGroupingsToOptInTo()) {
if (grouping.getPath().contains(this.GROUPING)) {
canOptin = true;
break;
}
}
assertFalse(canOptin);
boolean canOptOut = false;
for (Grouping grouping : groupings.getGroupingsToOptOutOf()) {
if (grouping.getPath().contains(this.GROUPING)) {
canOptOut = true;
break;
}
}
assertTrue(canOptOut);
boolean ownsGrouping = false;
for (Grouping grouping : groupings.getGroupingsOwned()) {
if (grouping.getPath().contains(this.GROUPING)) {
ownsGrouping = true;
break;
}
}
assertTrue(ownsGrouping);
}
use of edu.hawaii.its.api.type.GroupingAssignment in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingAssignmentServiceTest method getMyGroupingsTest.
@Test
public void getMyGroupingsTest() {
GroupingAssignment myGroupings = groupingAssignmentService.getGroupingAssignment(users.get(1).getUsername());
assertEquals(0, myGroupings.getGroupingsOwned().size());
assertEquals(5, myGroupings.getGroupingsIn().size());
assertEquals(0, myGroupings.getGroupingsOptedInTo().size());
assertEquals(0, myGroupings.getGroupingsOptedOutOf().size());
assertEquals(0, myGroupings.getGroupingsToOptInTo().size());
assertEquals(2, myGroupings.getGroupingsToOptOutOf().size());
}
use of edu.hawaii.its.api.type.GroupingAssignment in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestGroupingAssignmentService method groupingsInTest.
@Test
public void groupingsInTest() {
GroupingAssignment groupingAssignment = groupingAssignmentService.getGroupingAssignment(username[0]);
boolean inGrouping = false;
for (Grouping grouping : groupingAssignment.getGroupingsIn()) {
if (grouping.getPath().contains(GROUPING)) {
inGrouping = true;
break;
}
}
assertTrue(inGrouping);
inGrouping = false;
groupingAssignment = groupingAssignmentService.getGroupingAssignment(username[3]);
for (Grouping grouping : groupingAssignment.getGroupingsIn()) {
if (grouping.getPath().contains(GROUPING)) {
inGrouping = true;
break;
}
}
assertFalse(inGrouping);
}
Aggregations