private static OAuth2HandlerError getError(final String contextMessage, final Exception e, final String uri, final String description) { return new OAuth2HandlerError(TokenAuthorizationResponseHandler.ERROR, contextMessage, e, uri, description); } }
private static OAuth2HandlerError getError(final String contextMessage) { return BearerTokenHandler.getError(contextMessage, null); }
private static OAuth2HandlerError getError(final String contextMessage) { return MacTokenHandler.getError(contextMessage, null); }
@Test public void testHandleRequest_2() throws Exception { final CodeAuthorizationResponseHandler fixture = CodeAuthorizationResponseHandlerTest.carh; final OAuth2Accessor accessor = null; final HttpServletRequest request = new DummyHttpServletRequest(); final OAuth2HandlerError result = fixture.handleRequest(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, result.getError()); Assert.assertEquals("accessor is null", result.getContextMessage()); }
@SuppressWarnings("unused") @Test public void testProvideClientAuthenticationHandlers_1() throws Exception { final OAuth2HandlerModule fixture = new OAuth2HandlerModule(); final BasicAuthenticationHandler basicAuthenticationHandler = new BasicAuthenticationHandler(); final StandardAuthenticationHandler standardAuthenticationHandler = new StandardAuthenticationHandler(); final List<ClientAuthenticationHandler> result = OAuth2HandlerModule .provideClientAuthenticationHandlers(basicAuthenticationHandler, standardAuthenticationHandler); Assert.assertNotNull(result); Assert.assertEquals(2, result.size()); }
@SuppressWarnings("unused") @Test public void testProvideTokenHandlers_1() throws Exception { final OAuth2HandlerModule fixture = new OAuth2HandlerModule(); final BearerTokenHandler bearerTokenHandler = new BearerTokenHandler(); final MacTokenHandler macTokenHandler = new MacTokenHandler(); final List<ResourceRequestHandler> result = OAuth2HandlerModule.provideTokenHandlers( bearerTokenHandler, macTokenHandler); Assert.assertNotNull(result); Assert.assertEquals(2, result.size()); } }
protected static List<ClientAuthenticationHandler> getDummyClientAuthHandlers() throws Exception { final List<ClientAuthenticationHandler> ret = new ArrayList<ClientAuthenticationHandler>(2); ret.add(new BasicAuthenticationHandler()); ret.add(new StandardAuthenticationHandler()); return ret; }
private static OAuth2HandlerError getError(final String contextMessage) { return TokenAuthorizationResponseHandler.getError(contextMessage, null, "", ""); }
private static OAuth2HandlerError getError(final String contextMessage) { return StandardAuthenticationHandler.getError(contextMessage, null); }
private static OAuth2HandlerError getError(final String contextMessage) { return BasicAuthenticationHandler.getError(contextMessage, null); }
@Test public void testHandleRequest_2() throws Exception { final CodeAuthorizationResponseHandler fixture = CodeAuthorizationResponseHandlerTest.carh; final OAuth2Accessor accessor = null; final HttpServletRequest request = new DummyHttpServletRequest(); final OAuth2HandlerError result = fixture.handleRequest(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, result.getError()); Assert.assertEquals("accessor is null", result.getContextMessage()); }
@SuppressWarnings("unused") @Test public void testProvideClientAuthenticationHandlers_1() throws Exception { final OAuth2HandlerModule fixture = new OAuth2HandlerModule(); final BasicAuthenticationHandler basicAuthenticationHandler = new BasicAuthenticationHandler(); final StandardAuthenticationHandler standardAuthenticationHandler = new StandardAuthenticationHandler(); final List<ClientAuthenticationHandler> result = OAuth2HandlerModule .provideClientAuthenticationHandlers(basicAuthenticationHandler, standardAuthenticationHandler); Assert.assertNotNull(result); Assert.assertEquals(2, result.size()); }
private static OAuth2HandlerError getError(final String contextMessage, final Exception e) { return new OAuth2HandlerError(MacTokenHandler.ERROR, contextMessage, e); } }
@Test public void testHandleRequest_3() throws Exception { final CodeAuthorizationResponseHandler fixture = CodeAuthorizationResponseHandlerTest.carh; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpServletRequest request = new DummyHttpServletRequest(); final OAuth2HandlerError result = fixture.handleRequest(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, result.getError()); Assert.assertEquals("accessor is invalid", result.getContextMessage()); }
private static OAuth2HandlerError getError(final String contextMessage, final Exception e) { return new OAuth2HandlerError(BasicAuthenticationHandler.ERROR, contextMessage, e); } }
@Test public void testHandleRequest_3() throws Exception { final CodeAuthorizationResponseHandler fixture = CodeAuthorizationResponseHandlerTest.carh; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpServletRequest request = new DummyHttpServletRequest(); final OAuth2HandlerError result = fixture.handleRequest(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, result.getError()); Assert.assertEquals("accessor is invalid", result.getContextMessage()); }
public OAuth2HandlerError handleResponse(final OAuth2Accessor accessor, final HttpResponse response) { return new OAuth2HandlerError(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, "doesn't handle responses", null); }
@Test public void testHandleRequest_4() throws Exception { final CodeAuthorizationResponseHandler fixture = CodeAuthorizationResponseHandlerTest.carh; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_ClientCredentialsRedirecting(); final HttpServletRequest request = new DummyHttpServletRequest(); final OAuth2HandlerError result = fixture.handleRequest(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHORIZATION_CODE_PROBLEM, result.getError()); Assert.assertEquals("grant_type is not code", result.getContextMessage()); }
private static OAuth2HandlerError getError(final String contextMessage, final Exception e) { return new OAuth2HandlerError(BearerTokenHandler.ERROR, contextMessage, e, "", ""); } }
private static OAuth2HandlerError getError(final String contextMessage, final Exception e) { return new OAuth2HandlerError(StandardAuthenticationHandler.ERROR, contextMessage, e); } }