use of org.keycloak.admin.client.resource.GroupsResource in project keycloak by keycloak.
the class GroupTest method getGroupsWithFullRepresentation.
@Test
public void getGroupsWithFullRepresentation() {
RealmResource realm = adminClient.realms().realm("test");
GroupsResource groupsResource = adminClient.realms().realm("test").groups();
GroupRepresentation group = new GroupRepresentation();
group.setName("groupWithAttribute");
Map<String, List<String>> attributes = new HashMap<String, List<String>>();
attributes.put("attribute1", Arrays.asList("attribute1", "attribute2"));
group.setAttributes(attributes);
group = createGroup(realm, group);
List<GroupRepresentation> groups = groupsResource.groups("groupWithAttribute", 0, 20, false);
assertFalse(groups.isEmpty());
assertTrue(groups.get(0).getAttributes().containsKey("attribute1"));
}
Aggregations