use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class GroupsTest method testGetGroupsWithInclude.
private void testGetGroupsWithInclude() throws Exception {
// paging
int maxItems = 2;
Paging paging = getPaging(0, maxItems);
Map<String, String> otherParams = new HashMap<>();
// Validate that by default optionally fields aren't returned.
{
// list sites
ListResponse<Group> resp = getGroups(paging, null);
// check results
assertNotNull(resp);
assertNotNull(resp.getList());
assertFalse(resp.getList().isEmpty());
assertEquals(maxItems, resp.getList().size());
resp.getList().forEach(group -> validateGroupDefaultFields(group));
}
// Check include parent ids.
{
otherParams.put("include", org.alfresco.rest.api.Groups.PARAM_INCLUDE_PARENT_IDS);
// list sites
ListResponse<Group> resp = getGroups(paging, otherParams);
// check results
assertEquals(maxItems, resp.getList().size());
resp.getList().forEach(group -> {
assertNotNull(group);
assertNotNull(group.getParentIds());
});
}
// Check include zones.
{
otherParams.put("include", org.alfresco.rest.api.Groups.PARAM_INCLUDE_ZONES);
// list sites
ListResponse<Group> resp = getGroups(paging, otherParams);
// check results
assertEquals(maxItems, resp.getList().size());
resp.getList().forEach(group -> {
assertNotNull(group);
assertNotNull(group.getZones());
});
}
}
Aggregations