Search in sources :

Example 6 with ExceptionHandler

use of org.forgerock.oauth2.restlet.ExceptionHandler in project OpenAM by OpenRock.

the class TokenEndpointResourceTest method setUp.

@BeforeClass
@SuppressWarnings("unchecked")
public void setUp() {
    JacksonRepresentationFactory jacksonRepresentationFactory = new JacksonRepresentationFactory(new ObjectMapper());
    requestFactory = mock(OAuth2RequestFactory.class);
    accessTokenService = mock(AccessTokenService.class);
    OAuth2Representation representation = new OAuth2Representation(null);
    exceptionHandler = new ExceptionHandler(representation, null, null, jacksonRepresentationFactory);
    hook = mock(TokenRequestHook.class);
    tokenEndpointResource = new TokenEndpointResource(requestFactory, accessTokenService, exceptionHandler, CollectionUtils.asSet(hook), jacksonRepresentationFactory);
}
Also used : OAuth2RequestFactory(org.forgerock.oauth2.core.OAuth2RequestFactory) AccessTokenService(org.forgerock.oauth2.core.AccessTokenService) JacksonRepresentationFactory(org.forgerock.openam.rest.representations.JacksonRepresentationFactory) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

OAuth2Request (org.forgerock.oauth2.core.OAuth2Request)5 Request (org.restlet.Request)4 Response (org.restlet.Response)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 AccessToken (org.forgerock.oauth2.core.AccessToken)3 OAuth2ProviderSettings (org.forgerock.oauth2.core.OAuth2ProviderSettings)3 OAuth2ProviderSettingsFactory (org.forgerock.oauth2.core.OAuth2ProviderSettingsFactory)3 ResourceSetStore (org.forgerock.oauth2.resources.ResourceSetStore)3 ExtensionFilterManager (org.forgerock.openam.oauth2.extensions.ExtensionFilterManager)3 OAuth2RequestFactory (org.forgerock.oauth2.core.OAuth2RequestFactory)2 ExceptionHandler (org.forgerock.oauth2.restlet.ExceptionHandler)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Evaluator (com.sun.identity.entitlement.Evaluator)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Subject (javax.security.auth.Subject)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 AccessTokenService (org.forgerock.oauth2.core.AccessTokenService)1 ClientRegistration (org.forgerock.oauth2.core.ClientRegistration)1 ClientRegistrationStore (org.forgerock.oauth2.core.ClientRegistrationStore)1