@Before public void setUp() { this.PROVIDER = new OAuth2Provider(); this.PROVIDER.setAuthorizationHeader(true); this.PROVIDER.setAuthorizationUrl("xxx"); this.PROVIDER.setClientAuthenticationType(OAuth2Message.BASIC_AUTH_TYPE); this.PROVIDER.setName("yyy"); this.PROVIDER.setTokenUrl("zzz"); this.PROVIDER.setUrlParameter(false); }
@Test public void testClearTokens_1() throws Exception { Assert.assertNotNull(this.cache.getToken(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME, MockUtils.USER, MockUtils.SCOPE, Type.ACCESS)); this.cache.clearTokens(); Assert.assertNull(this.cache.getToken(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME, MockUtils.USER, MockUtils.SCOPE, Type.ACCESS)); }
@Test public void testOAuth2GadgetBinding_1() throws Exception { final OAuth2GadgetBinding result = new OAuth2GadgetBinding("xxx", "yyy", "zzz", false); Assert.assertNotNull(result); Assert.assertEquals("zzz", result.getClientName()); Assert.assertEquals("yyy", result.getGadgetServiceName()); Assert.assertEquals("xxx", result.getGadgetUri()); Assert.assertEquals(false, result.isAllowOverride()); }
@Test public void testDecrypt_2() throws Exception { final NoOpEncrypter fixture = new NoOpEncrypter(); final byte[] result = fixture.decrypt(null); Assert.assertEquals(null, result); }
@Test public void testClearClients_1() throws Exception { Assert.assertNotNull(this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME)); this.cache.clearClients(); Assert.assertNull(this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME)); }
@Test public void testRemoveClient_1() throws Exception { OAuth2Client result = this.cache.getClient(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNotNull(result); result = this.cache.removeClient(result); Assert.assertNull(result); }
@Test public void testGetClientName_1() throws Exception { final String result = OAuth2GadgetBindingTest.FIXTURE.getClientName(); Assert.assertEquals("xxx", result); }
@Test public void testGetClientAuthenticationType_1() throws Exception { final String result = this.PROVIDER.getClientAuthenticationType(); Assert.assertEquals(OAuth2Message.BASIC_AUTH_TYPE, result); }
@Test public void testGetName_1() throws Exception { final String result = this.PROVIDER.getName(); Assert.assertEquals("yyy", result); }
@Test public void testIsAuthorizationHeader_1() throws Exception { final boolean result = this.PROVIDER.isAuthorizationHeader(); Assert.assertEquals(true, result); }
@Test public void testGetGadgetServiceName_1() throws Exception { final String result = OAuth2GadgetBindingTest.FIXTURE.getGadgetServiceName(); Assert.assertEquals(MockUtils.SERVICE_NAME, result); }
@Test public void testGetGadgetUri_1() throws Exception { final String result = OAuth2GadgetBindingTest.FIXTURE.getGadgetUri(); Assert.assertEquals(MockUtils.GADGET_URI1, result); }
@Test public void testIsAllowOverride_2() throws Exception { final boolean result = OAuth2GadgetBindingTest.FIXTURE.isAllowOverride(); Assert.assertEquals(true, result); }
@Test public void testHashCode_1() throws Exception { final int result = this.PROVIDER.hashCode(); Assert.assertEquals(120153, result); }
@Test public void testEquals_3() throws Exception { final boolean result = OAuth2GadgetBindingTest.FIXTURE.equals(null); Assert.assertEquals(false, result); }
@Before public void setUp() { this.PROVIDER = new OAuth2Provider(); this.PROVIDER.setAuthorizationHeader(true); this.PROVIDER.setAuthorizationUrl("xxx"); this.PROVIDER.setClientAuthenticationType(OAuth2Message.BASIC_AUTH_TYPE); this.PROVIDER.setName("yyy"); this.PROVIDER.setTokenUrl("zzz"); this.PROVIDER.setUrlParameter(false); }
@Test public void testClearTokens_1() throws Exception { Assert.assertNotNull(this.cache.getToken(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME, MockUtils.USER, MockUtils.SCOPE, Type.ACCESS)); this.cache.clearTokens(); Assert.assertNull(this.cache.getToken(MockUtils.GADGET_URI1, MockUtils.SERVICE_NAME, MockUtils.USER, MockUtils.SCOPE, Type.ACCESS)); }
@Test public void testGetClientName_1() throws Exception { final String result = OAuth2GadgetBindingTest.FIXTURE.getClientName(); Assert.assertEquals("xxx", result); }
@Test public void testIsAuthorizationHeader_2() throws Exception { final OAuth2Provider fixture = new OAuth2Provider(); fixture.setTokenUrl(""); fixture.setClientAuthenticationType(""); fixture.setAuthorizationUrl(""); fixture.setAuthorizationHeader(false); fixture.setName(""); fixture.setUrlParameter(true); final boolean result = fixture.isAuthorizationHeader(); Assert.assertEquals(false, result); }