use of com.amazonaws.mobileconnectors.appsync.sigv4.BasicCognitoUserPoolsAuthProvider in project aws-mobile-appsync-sdk-android by awslabs.
the class AppSyncClientUnitTest method testConfigMismatch_AmazonCognitoUserPools.
@Test(expected = RuntimeException.class)
public void testConfigMismatch_AmazonCognitoUserPools() {
awsConfiguration.setConfiguration("ApiKey");
APIKeyAuthProvider apiKeyAuthProvider = new BasicAPIKeyAuthProvider(awsConfiguration);
awsConfiguration.setConfiguration("AmazonCognitoUserPools");
CognitoUserPool cognitoUserPool = new CognitoUserPool(shadowContext, awsConfiguration);
BasicCognitoUserPoolsAuthProvider basicCognitoUserPoolsAuthProvider = new BasicCognitoUserPoolsAuthProvider(cognitoUserPool);
final AWSAppSyncClient awsAppSyncClient = AWSAppSyncClient.builder().context(shadowContext).awsConfiguration(awsConfiguration).apiKey(apiKeyAuthProvider).build();
}
use of com.amazonaws.mobileconnectors.appsync.sigv4.BasicCognitoUserPoolsAuthProvider in project aws-mobile-appsync-sdk-android by awslabs.
the class AppSyncClientUnitTest method testAmazonCognitoUserPoolsAuthProvider.
@Test
public void testAmazonCognitoUserPoolsAuthProvider() {
awsConfiguration.setConfiguration("AmazonCognitoUserPools");
CognitoUserPool cognitoUserPool = new CognitoUserPool(shadowContext, awsConfiguration);
BasicCognitoUserPoolsAuthProvider basicCognitoUserPoolsAuthProvider = new BasicCognitoUserPoolsAuthProvider(cognitoUserPool);
final AWSAppSyncClient awsAppSyncClient = AWSAppSyncClient.builder().context(shadowContext).awsConfiguration(awsConfiguration).cognitoUserPoolsAuthProvider(basicCognitoUserPoolsAuthProvider).build();
assertNotNull(awsAppSyncClient);
}
use of com.amazonaws.mobileconnectors.appsync.sigv4.BasicCognitoUserPoolsAuthProvider in project aws-mobile-appsync-sdk-android by awslabs.
the class AppSyncClientUnitTest method testMultipleAuth.
@Test(expected = RuntimeException.class)
public void testMultipleAuth() {
awsConfiguration.setConfiguration("ApiKey");
APIKeyAuthProvider apiKeyAuthProvider = new BasicAPIKeyAuthProvider(awsConfiguration);
awsConfiguration.setConfiguration("AmazonCognitoUserPools");
CognitoUserPool cognitoUserPool = new CognitoUserPool(shadowContext, awsConfiguration);
BasicCognitoUserPoolsAuthProvider basicCognitoUserPoolsAuthProvider = new BasicCognitoUserPoolsAuthProvider(cognitoUserPool);
final AWSAppSyncClient awsAppSyncClient = AWSAppSyncClient.builder().context(shadowContext).awsConfiguration(awsConfiguration).apiKey(apiKeyAuthProvider).cognitoUserPoolsAuthProvider(basicCognitoUserPoolsAuthProvider).build();
}
Aggregations