Search in sources :

Example 1 with ResourceOwnerConsentVerifier

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

the class AuthorizationServiceImplTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    requestValidator = mock(AuthorizeRequestValidator.class);
    List<AuthorizeRequestValidator> requestValidators = new ArrayList<AuthorizeRequestValidator>();
    requestValidators.add(requestValidator);
    resourceOwnerSessionValidator = mock(ResourceOwnerSessionValidator.class);
    OAuth2ProviderSettingsFactory providerSettingsFactory = mock(OAuth2ProviderSettingsFactory.class);
    resourceOwnerConsentVerifier = mock(ResourceOwnerConsentVerifier.class);
    clientRegistrationStore = mock(ClientRegistrationStore.class);
    tokenIssuer = mock(AuthorizationTokenIssuer.class);
    ClientAuthenticationFailureFactory failureFactory = mock(ClientAuthenticationFailureFactory.class);
    authorizationService = new AuthorizationServiceImpl(requestValidators, resourceOwnerSessionValidator, providerSettingsFactory, resourceOwnerConsentVerifier, clientRegistrationStore, tokenIssuer, failureFactory);
    providerSettings = mock(OAuth2ProviderSettings.class);
    given(providerSettingsFactory.get(Matchers.<OAuth2Request>anyObject())).willReturn(providerSettings);
}
Also used : ArrayList(java.util.ArrayList) ClientAuthenticationFailureFactory(org.forgerock.oauth2.core.exceptions.ClientAuthenticationFailureFactory) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

ArrayList (java.util.ArrayList)1 ClientAuthenticationFailureFactory (org.forgerock.oauth2.core.exceptions.ClientAuthenticationFailureFactory)1 BeforeMethod (org.testng.annotations.BeforeMethod)1