use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestGroupingAssignmentService method grouperTest.
@Test
public void grouperTest() {
List<String> groupPaths = groupingAssignmentService.getGroupPaths(username[0]);
List<String> groupings = new ArrayList<>();
List<String> groupings2 = new ArrayList<>();
if (groupPaths.size() > 0) {
List<WsAttributeAssign> attributes = new ArrayList<>();
for (String path : groupPaths) {
WsGetAttributeAssignmentsResults trioGroups = new GcGetAttributeAssignments().addAttributeDefNameName(TRIO).assignAttributeAssignType(ASSIGN_TYPE_GROUP).addOwnerGroupName(path).execute();
if (trioGroups.getWsAttributeAssigns() != null) {
Collections.addAll(attributes, trioGroups.getWsAttributeAssigns());
}
}
if (attributes.size() > 0) {
groupings.addAll(attributes.stream().map(WsAttributeAssign::getOwnerGroupName).collect(Collectors.toList()));
}
assertNotNull(groupings);
// ////////////////////////////////////////////////////////////////////////////////
GcGetAttributeAssignments trioGroups2 = new GcGetAttributeAssignments().addAttributeDefNameName(TRIO).assignAttributeAssignType(ASSIGN_TYPE_GROUP);
groupPaths.forEach(trioGroups2::addOwnerGroupName);
WsGetAttributeAssignmentsResults attributeAssignmentsResults2 = trioGroups2.execute();
assertNotNull(attributeAssignmentsResults2);
WsAttributeAssign[] wsGroups2 = attributeAssignmentsResults2.getWsAttributeAssigns();
if (wsGroups2 != null && wsGroups2.length > 0) {
for (WsAttributeAssign grouping : wsGroups2) {
groupings2.add(grouping.getOwnerGroupName());
}
}
}
assertNotNull(groupings2);
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestGroupingAssignmentService method updateLastModifiedTest.
@Test
public void updateLastModifiedTest() {
// Test is accurate to the minute, and if checks to see if the current
// time gets added to the lastModified attribute of a group if the
// minute happens to change in between getting the time and setting
// the time, the test will fail.
final String group = GROUPING_INCLUDE;
GroupingsServiceResult gsr = membershipService.updateLastModified(group);
String dateStr = gsr.getAction().split(" to time ")[1];
WsGetAttributeAssignmentsResults assignments = groupAttributeService.attributeAssignmentsResults(ASSIGN_TYPE_GROUP, group, YYYYMMDDTHHMM);
String assignedValue = assignments.getWsAttributeAssigns()[0].getWsAttributeAssignValues()[0].getValueSystem();
assertEquals(dateStr, assignedValue);
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestMembershipService method updateLastModifiedTest.
@Test
public void updateLastModifiedTest() {
// Test is accurate to the minute, and if checks to see if the current
// time gets added to the lastModified attribute of a group if the
// minute happens to change in between getting the time and setting
// the time, the test will fail.
final String group = GROUPING_INCLUDE;
GroupingsServiceResult gsr = membershipService.updateLastModified(group);
String dateStr = gsr.getAction().split(" to time ")[1];
WsGetAttributeAssignmentsResults assignments = groupAttributeService.attributeAssignmentsResults(ASSIGN_TYPE_GROUP, group, YYYYMMDDTHHMM);
String assignedValue = assignments.getWsAttributeAssigns()[0].getWsAttributeAssignValues()[0].getValueSystem();
assertEquals(dateStr, assignedValue);
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsGetAttributeAssignmentsResultsTrio.
@Override
public List<WsGetAttributeAssignmentsResults> makeWsGetAttributeAssignmentsResultsTrio(String assignType, String attributeDefNameName0, String attributeDefNameName1, List<String> ownerGroupNames) {
List<WsGetAttributeAssignmentsResults> resultsList = new ArrayList<>();
WsGetAttributeAssignmentsResults wsGetAttributeAssignmentsResults = makeWsGetAttributeAssignmentsResultsTrio(assignType, attributeDefNameName0, attributeDefNameName1);
wsGetAttributeAssignmentsResults = removeGroupsNotInList(wsGetAttributeAssignmentsResults, ownerGroupNames);
resultsList.add(wsGetAttributeAssignmentsResults);
return resultsList;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingAssignmentServiceImpl method adminLists.
// returns an adminLists object containing the list of all admins and all groupings
@Override
public AdminListsHolder adminLists(String adminUsername) {
AdminListsHolder info = new AdminListsHolder();
List<Grouping> groupings;
if (memberAttributeService.isSuperuser(adminUsername)) {
WsGetAttributeAssignmentsResults attributeAssignmentsResults = grouperFS.makeWsGetAttributeAssignmentsResultsTrio(ASSIGN_TYPE_GROUP, TRIO);
List<WsGroup> groups = new ArrayList<>(Arrays.asList(attributeAssignmentsResults.getWsGroups()));
List<String> groupPaths = groups.stream().map(WsGroup::getName).collect(Collectors.toList());
Group admin = getMembers(adminUsername, GROUPING_ADMINS);
groupings = helperService.makeGroupings(groupPaths);
info.setAdminGroup(admin);
info.setAllGroupings(groupings);
}
return info;
}
Aggregations