@Test public void testGetGrantType_1() throws Exception { final String result = OAuth2ClientTest.client1.getGrantType(); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Message.AUTHORIZATION_CODE, result); }
@Test public void testGetGrantType_1() throws Exception { final String result = OAuth2ClientTest.client1.getGrantType(); Assert.assertNotNull(result); Assert.assertEquals(OAuth2Message.AUTHORIZATION_CODE, result); }
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(MockUtils.REDIRECT_URI, client.getRedirectUri()); Assert.assertEquals(MockUtils.SERVICE_NAME, client.getServiceName()); 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(MockUtils.REDIRECT_URI, client.getRedirectUri()); Assert.assertEquals(MockUtils.SERVICE_NAME, client.getServiceName());
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(MockUtils.REDIRECT_URI, client.getRedirectUri()); Assert.assertEquals(MockUtils.SERVICE_NAME, client.getServiceName()); 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(MockUtils.REDIRECT_URI, client.getRedirectUri()); Assert.assertEquals(MockUtils.SERVICE_NAME, client.getServiceName());
newAccessor.setClientId(client.getClientId()); newAccessor.setClientSecret(client.getClientSecret()); newAccessor.setGrantType(client.getGrantType()); newAccessor.setRedirectUri(client.getRedirectUri()); newAccessor.setRefreshToken(refreshToken);
@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()); }