@Test public void testGetClientSecret_1() throws Exception { final byte[] result = OAuth2ClientTest.client1.getClientSecret(); Assert.assertNotNull(result); Assert.assertEquals(MockUtils.CLIENT_SECRET1, new String(result, "UTF-8")); }
@Test public void testGetClientSecret_1() throws Exception { final byte[] result = OAuth2ClientTest.client1.getClientSecret(); Assert.assertNotNull(result); Assert.assertEquals(MockUtils.CLIENT_SECRET1, new String(result, "UTF-8")); }
Assert.assertEquals(OAuth2Message.BASIC_AUTH_TYPE, client.getClientAuthenticationType()); Assert.assertEquals(MockUtils.CLIENT_ID1, client.getClientId()); Assert.assertEquals(MockUtils.CLIENT_SECRET1, new String(client.getClientSecret(), "UTF-8")); Assert.assertEquals(MockUtils.getDummyEncrypter(), client.getEncrypter()); Assert.assertEquals(OAuth2Message.AUTHORIZATION, client.getGrantType()); Assert.assertEquals(OAuth2Message.STANDARD_AUTH_TYPE, client.getClientAuthenticationType()); Assert.assertEquals(MockUtils.CLIENT_ID2, client.getClientId()); Assert.assertEquals(MockUtils.CLIENT_SECRET2, new String(client.getClientSecret(), "UTF-8")); Assert.assertEquals(MockUtils.getDummyEncrypter(), client.getEncrypter()); Assert.assertEquals(OAuth2Message.CLIENT_CREDENTIALS, client.getGrantType());
Assert.assertEquals(OAuth2Message.BASIC_AUTH_TYPE, client.getClientAuthenticationType()); Assert.assertEquals(MockUtils.CLIENT_ID1, client.getClientId()); Assert.assertEquals(MockUtils.CLIENT_SECRET1, new String(client.getClientSecret(), "UTF-8")); Assert.assertEquals(MockUtils.getDummyEncrypter(), client.getEncrypter()); Assert.assertEquals(OAuth2Message.AUTHORIZATION, client.getGrantType()); Assert.assertEquals(OAuth2Message.STANDARD_AUTH_TYPE, client.getClientAuthenticationType()); Assert.assertEquals(MockUtils.CLIENT_ID2, client.getClientId()); Assert.assertEquals(MockUtils.CLIENT_SECRET2, new String(client.getClientSecret(), "UTF-8")); Assert.assertEquals(MockUtils.getDummyEncrypter(), client.getEncrypter()); Assert.assertEquals(OAuth2Message.CLIENT_CREDENTIALS, client.getGrantType());
newAccessor.setUrlParameter(client.isUrlParameter()); newAccessor.setClientId(client.getClientId()); newAccessor.setClientSecret(client.getClientSecret()); newAccessor.setGrantType(client.getGrantType()); newAccessor.setRedirectUri(client.getRedirectUri());
@Test public void testOAuth2Client_1() throws Exception { final OAuth2Client result = new OAuth2Client(MockUtils.getDummyEncrypter()); Assert.assertNotNull(result); Assert.assertEquals(null, result.getAuthorizationUrl()); Assert.assertEquals(null, result.getClientAuthenticationType()); Assert.assertEquals(null, result.getClientId()); Assert.assertEquals(null, result.getClientSecret()); Assert.assertEquals(null, result.getEncryptedSecret()); Assert.assertEquals(null, result.getGadgetUri()); Assert.assertEquals("NONE", result.getGrantType()); Assert.assertEquals(null, result.getRedirectUri()); Assert.assertEquals(null, result.getServiceName()); Assert.assertEquals(null, result.getTokenUrl()); Assert.assertEquals(false, result.isAllowModuleOverride()); Assert.assertEquals(false, result.isAuthorizationHeader()); Assert.assertEquals(false, result.isUrlParameter()); Assert .assertEquals( "org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2ClientImpl: serviceName = null , redirectUri = null , gadgetUri = null , clientId = null , grantType = NONE , type = UNKNOWN , grantType = NONE , tokenUrl = null , authorizationUrl = null , this.clientAuthenticationType = null , this.sharedToken = false, this.allowedDomains = []", result.toString()); }
@Test public void testOAuth2Client_1() throws Exception { final OAuth2Client result = new OAuth2Client(MockUtils.getDummyEncrypter()); Assert.assertNotNull(result); Assert.assertEquals(null, result.getAuthorizationUrl()); Assert.assertEquals(null, result.getClientAuthenticationType()); Assert.assertEquals(null, result.getClientId()); Assert.assertEquals(null, result.getClientSecret()); Assert.assertEquals(null, result.getEncryptedSecret()); Assert.assertEquals(null, result.getGadgetUri()); Assert.assertEquals("NONE", result.getGrantType()); Assert.assertEquals(null, result.getRedirectUri()); Assert.assertEquals(null, result.getServiceName()); Assert.assertEquals(null, result.getTokenUrl()); Assert.assertEquals(false, result.isAllowModuleOverride()); Assert.assertEquals(false, result.isAuthorizationHeader()); Assert.assertEquals(false, result.isUrlParameter()); Assert .assertEquals( "org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2ClientImpl: serviceName = null , redirectUri = null , gadgetUri = null , clientId = null , grantType = NONE , type = UNKNOWN , grantType = NONE , tokenUrl = null , authorizationUrl = null , this.clientAuthenticationType = null , this.sharedToken = false, this.allowedDomains = []", result.toString()); }