use of org.forgerock.openam.rest.representations.JacksonRepresentationFactory in project OpenAM by OpenRock.
the class ResourceSetRegistrationExceptionFilterTest method setup.
@BeforeMethod
public void setup() {
Restlet next = mock(Restlet.class);
JacksonRepresentationFactory jacksonRepresentationFactory = new JacksonRepresentationFactory(new ObjectMapper());
exceptionFilter = new ResourceSetRegistrationExceptionFilter(next, jacksonRepresentationFactory);
}
use of org.forgerock.openam.rest.representations.JacksonRepresentationFactory in project OpenAM by OpenRock.
the class OpenAMTokenStoreTest method setUp.
@BeforeMethod
public void setUp() {
tokenStore = mock(OAuthTokenStore.class);
providerSettingsFactory = mock(OAuth2ProviderSettingsFactory.class);
oAuth2UrisFactory = mock(OAuth2UrisFactory.class);
clientRegistrationStore = mock(OpenIdConnectClientRegistrationStore.class);
realmNormaliser = mock(RealmNormaliser.class);
ssoTokenManager = mock(SSOTokenManager.class);
request = mock(Request.class);
cookieExtractor = mock(CookieExtractor.class);
auditLogger = mock(OAuth2AuditLogger.class);
debug = mock(Debug.class);
failureFactory = mock(ClientAuthenticationFailureFactory.class);
oAuth2RequestFactory = new RestletOAuth2RequestFactory(new JacksonRepresentationFactory(new ObjectMapper()));
ClientAuthenticationFailureFactory failureFactory = mock(ClientAuthenticationFailureFactory.class);
InvalidClientException expectedResult = mock(InvalidClientException.class);
when(expectedResult.getError()).thenReturn(new String("invalid_client"));
when(failureFactory.getException()).thenReturn(expectedResult);
when(failureFactory.getException(anyString())).thenReturn(expectedResult);
when(failureFactory.getException(any(OAuth2Request.class), anyString())).thenReturn(expectedResult);
openAMtokenStore = new OpenAMTokenStore(tokenStore, providerSettingsFactory, oAuth2UrisFactory, clientRegistrationStore, realmNormaliser, ssoTokenManager, cookieExtractor, auditLogger, debug, new SecureRandom(), failureFactory);
}
use of org.forgerock.openam.rest.representations.JacksonRepresentationFactory in project OpenAM by OpenRock.
the class RestletOAuth2RequestTest method theSetUp.
@BeforeMethod
private void theSetUp() {
//you need this
request = new Request();
Reference reference = new Reference("http://127.0.0.1:8080/test");
request.setResourceRef(reference);
request.setMethod(Method.POST);
JacksonRepresentationFactory jacksonRepresentationFactory = new JacksonRepresentationFactory(new ObjectMapper());
requestUnderTest = new RestletOAuth2Request(jacksonRepresentationFactory, request);
}
use of org.forgerock.openam.rest.representations.JacksonRepresentationFactory 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);
}
Aggregations