@Test(expected = OAuth2RequestException.class) public void testGetCompleteUrl_2() throws Exception { final CodeGrantTypeHandler fixture = CodeGrantTypeHandlerTest.cgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); fixture.getCompleteUrl(accessor); }
@Test(expected = OAuth2RequestException.class) public void testGetAuthorizationRequest_3() throws Exception { final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final String completeAuthorizationUrl = "xxx"; fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl); }
@Test(expected = OAuth2RequestException.class) public void testGetAuthorizationRequest_3() throws Exception { final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final String completeAuthorizationUrl = "xxx"; fixture.getAuthorizationRequest(accessor, completeAuthorizationUrl); }
@Test(expected = OAuth2RequestException.class) public void testGetCompleteUrl_2() throws Exception { final CodeGrantTypeHandler fixture = CodeGrantTypeHandlerTest.cgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); fixture.getCompleteUrl(accessor); }
@Test(expected = OAuth2RequestException.class) public void testGetCompleteUrl_2() throws Exception { final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); fixture.getCompleteUrl(accessor); }
@Test(expected = OAuth2RequestException.class) public void testGetCompleteUrl_2() throws Exception { final ClientCredentialsGrantTypeHandler fixture = ClientCredentialsGrantTypeHandlerTest.ccgth; final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); fixture.getCompleteUrl(accessor); }
@Test public void testHandlesResponse_1() throws Exception { final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpResponse response = new HttpResponse(); final boolean result = TokenAuthorizationResponseHandlerTest.tarh.handlesResponse(accessor, response); Assert.assertFalse(result); }
@Test public void testHandlesResponse_1() throws Exception { final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpResponse response = new HttpResponse(); final boolean result = TokenAuthorizationResponseHandlerTest.tarh.handlesResponse(accessor, response); Assert.assertFalse(result); }
@Test public void testAddOAuth2Authentication3() throws Exception { final BasicAuthenticationHandler fixture = new BasicAuthenticationHandler(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final OAuth2HandlerError result = fixture.addOAuth2Authentication(request, accessor); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.AUTHENTICATION_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@Test public void testAddOAuth2Authentication3() throws Exception { final BasicAuthenticationHandler fixture = new BasicAuthenticationHandler(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final OAuth2HandlerError result = fixture.addOAuth2Authentication(request, accessor); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.AUTHENTICATION_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@Test public void testAddOAuth2Params_3() throws Exception { final MacTokenHandler fixture = new MacTokenHandler(); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2HandlerError result = fixture.addOAuth2Params(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.MAC_TOKEN_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@Test public void testAddOAuth2Params_3() throws Exception { final MacTokenHandler fixture = new MacTokenHandler(); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2HandlerError result = fixture.addOAuth2Params(accessor, request); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.MAC_TOKEN_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@Test public void testAddOAuth2Authentication_3() throws Exception { final StandardAuthenticationHandler fixture = new StandardAuthenticationHandler(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final OAuth2HandlerError result = fixture.addOAuth2Authentication(request, accessor); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHENTICATION_PROBLEM, result.getError()); Assert.assertEquals(null, result.getCause()); Assert.assertEquals("accessor is invalid", result.getContextMessage()); }
@Test public void testAddOAuth2Authentication_3() throws Exception { final StandardAuthenticationHandler fixture = new StandardAuthenticationHandler(); final HttpRequest request = new HttpRequest(Uri.fromJavaUri(new URI(""))); final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final OAuth2HandlerError result = fixture.addOAuth2Authentication(request, accessor); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Error.AUTHENTICATION_PROBLEM, result.getError()); Assert.assertEquals(null, result.getCause()); Assert.assertEquals("accessor is invalid", result.getContextMessage()); }
@Test public void testHandleResponse_1() throws Exception { final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpResponse response = new HttpResponse(); final OAuth2HandlerError result = TokenAuthorizationResponseHandlerTest.tarh.handleResponse( accessor, response); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.TOKEN_RESPONSE_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@Test public void testHandleResponse_1() throws Exception { final OAuth2Accessor accessor = MockUtils.getOAuth2Accessor_Error(); final HttpResponse response = new HttpResponse(); final OAuth2HandlerError result = TokenAuthorizationResponseHandlerTest.tarh.handleResponse( accessor, response); Assert.assertNotNull(result); Assert.assertEquals(null, result.getCause()); Assert.assertEquals(OAuth2Error.TOKEN_RESPONSE_PROBLEM, result.getError()); Assert.assertTrue(result.getContextMessage().startsWith("accessor is invalid")); }
@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()); }
@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()); }
@Before public void setUp() throws Exception { this.cache = new InMemoryCache(); Assert.assertNotNull(this.cache); Assert.assertTrue(OAuth2Cache.class.isInstance(this.cache)); this.cache.storeClient(MockUtils.getClient_Code_Confidential()); this.cache.storeClient(MockUtils.getClient_Code_Public()); this.cache.storeToken(MockUtils.getAccessToken()); this.cache.storeToken(MockUtils.getRefreshToken()); this.cache.storeOAuth2Accessor(MockUtils.getOAuth2Accessor_Code()); this.cache.storeOAuth2Accessor(MockUtils.getOAuth2Accessor_Error()); }
@Before public void setUp() throws Exception { this.cache = new InMemoryCache(); Assert.assertNotNull(this.cache); Assert.assertTrue(OAuth2Cache.class.isInstance(this.cache)); this.cache.storeClient(MockUtils.getClient_Code_Confidential()); this.cache.storeClient(MockUtils.getClient_Code_Public()); this.cache.storeToken(MockUtils.getAccessToken()); this.cache.storeToken(MockUtils.getRefreshToken()); this.cache.storeOAuth2Accessor(MockUtils.getOAuth2Accessor_Code()); this.cache.storeOAuth2Accessor(MockUtils.getOAuth2Accessor_Error()); }