Search in sources :

Example 21 with ResourceOwner

use of org.forgerock.oauth2.core.ResourceOwner in project OpenAM by OpenRock.

the class UmaPolicyServiceImplDelegationTest method registerResourceSet.

private String registerResourceSet(String resourceOwner) throws Exception {
    setupIdentityForUser(resourceOwner, loggedInRealm);
    String resourceSetId = UUID.randomUUID().toString();
    ResourceSetDescription resourceSet = new ResourceSetDescription(resourceSetId, "CLIENT_ID", resourceOwner, json(object(field("name", "RESOURCE_SET_NAME"), field("scopes", array("SCOPE_A", "SCOPE_B")))).asMap());
    given(resourceSetStore.read(resourceSetId, resourceOwner)).willReturn(resourceSet);
    given(resourceSetStore.query(QueryFilter.and(QueryFilter.equalTo(ResourceSetTokenField.RESOURCE_SET_ID, resourceSetId)))).willReturn(Collections.singleton(resourceSet));
    return resourceSetId;
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) ResourceSetDescription(org.forgerock.oauth2.resources.ResourceSetDescription)

Aggregations

ServerException (org.forgerock.oauth2.core.exceptions.ServerException)11 ResourceOwner (org.forgerock.oauth2.core.ResourceOwner)8 SSOException (com.iplanet.sso.SSOException)7 AMIdentity (com.sun.identity.idm.AMIdentity)7 IdRepoException (com.sun.identity.idm.IdRepoException)6 OAuth2ProviderSettings (org.forgerock.oauth2.core.OAuth2ProviderSettings)6 OAuth2Request (org.forgerock.oauth2.core.OAuth2Request)6 InvalidClientException (org.forgerock.oauth2.core.exceptions.InvalidClientException)6 NotFoundException (org.forgerock.oauth2.core.exceptions.NotFoundException)6 UnauthorizedClientException (org.forgerock.oauth2.core.exceptions.UnauthorizedClientException)6 ParseException (java.text.ParseException)4 SMSException (com.sun.identity.sm.SMSException)3 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 DeviceCode (org.forgerock.oauth2.core.DeviceCode)3 SSOToken (com.iplanet.sso.SSOToken)2 AuthLoginException (com.sun.identity.authentication.spi.AuthLoginException)2 Set (java.util.Set)2 AccessToken (org.forgerock.oauth2.core.AccessToken)2