Search in sources :

Example 11 with WsGetGroupsResult

use of edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResult in project cas by apereo.

the class GrouperFacadeTests method verifyEmptyGroups.

@Test
public void verifyEmptyGroups() {
    val facade = new DefaultGrouperFacade() {

        @Override
        public WsGetGroupsResult[] fetchGroupsFor(final String subjectId) {
            return null;
        }
    };
    assertTrue(facade.getGroupsForSubjectId("casuser").isEmpty());
}
Also used : lombok.val(lombok.val) WsGetGroupsResult(edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResult) Test(org.junit.jupiter.api.Test)

Example 12 with WsGetGroupsResult

use of edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResult in project cas by apereo.

the class GrouperFacadeTests method verifyFailedGroups.

@Test
public void verifyFailedGroups() {
    val facade = new DefaultGrouperFacade() {

        @Override
        public WsGetGroupsResult[] fetchGroupsFor(final String subjectId) {
            throw new RuntimeException("BadGroups");
        }
    };
    assertTrue(facade.getGroupsForSubjectId("casuser").isEmpty());
}
Also used : lombok.val(lombok.val) WsGetGroupsResult(edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResult) Test(org.junit.jupiter.api.Test)

Aggregations

WsGetGroupsResult (edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResult)11 lombok.val (lombok.val)7 WsGroup (edu.internet2.middleware.grouperClient.ws.beans.WsGroup)5 Test (org.junit.jupiter.api.Test)5 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 WsGetGroupsResults (edu.internet2.middleware.grouperClient.ws.beans.WsGetGroupsResults)3 HashMap (java.util.HashMap)3 Collectors (java.util.stream.Collectors)3 Slf4j (lombok.extern.slf4j.Slf4j)3 GrouperFacade (org.apereo.cas.grouper.GrouperFacade)3 GrouperGroupField (org.apereo.cas.grouper.GrouperGroupField)3 GcGetGroups (edu.internet2.middleware.grouperClient.api.GcGetGroups)2 WsStemLookup (edu.internet2.middleware.grouperClient.ws.beans.WsStemLookup)2 StringUtils (edu.internet2.middleware.grouperClientExt.org.apache.commons.lang3.StringUtils)2 Collection (java.util.Collection)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Function (java.util.function.Function)2 Stream (java.util.stream.Stream)2