KeyCloakGroupManager extends BaseKeyCloakManager implements GroupManager,
                                                                         ContextualManager { @Override public Group get(String identifier) throws SecurityManagementException { checkNotNull("identifier", identifier); final RoleResource[] roleResource = new RoleResource[1]; consumeRealm(realmResource -> { final RolesResource rolesResource = realmResource.roles(); roleResource[0] = rolesResource.get(identifier); }); if (roleResource[0] != null) { final RoleRepresentation roleRepresentation = getRoleRepresentation(identifier, roleResource[0]); Group g = createGroup(roleRepresentation); if (g != null) { return g; } } throw new GroupNotFoundException(identifier); } KeyCloakGroupManager(); @Override void initialize(UserSystemManager userSystemManager); @Override SearchResponse<Group> search(SearchRequest request); @Override Group get(String identifier); @Override List<Group> getAll(); @Override Group create(Group entity); @Override Group update(Group entity); @Override void delete(String... identifiers); @Override GroupManagerSettings getSettings(); @Override void assignUsers(String name,
                            Collection<String> users); @Override void destroy();  }
@Test(expected = RealmManagementNotAuthorizedException.class) public void testGroupNotAuthorized() throws Exception { initGroupManager(); doThrow(mockForbiddenResponse()).when(keycloakMock).realm(); groupsManager.get(ROLE); }
@Test public void testGetGroup5() { String name = ROLE + 5; Group group = groupsManager.get(name); assertGroup(group, name); }
@Test(expected = GroupNotFoundException.class) public void testGetGroup200() { String name = ROLE + 200; Group group = groupsManager.get(name); }