use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class KinesisIOWriteTest method testReadWithCredentialsProvider.
@Test
public void testReadWithCredentialsProvider() {
Regions region = Regions.US_EAST_1;
AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
Write write = KinesisIO.write().withAWSClientsProvider(credentialsProvider, region);
assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, null, true));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class KinesisIOWriteTest method testReadWithCredentialsProviderAndVerificationDisabled.
@Test
public void testReadWithCredentialsProviderAndVerificationDisabled() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
Write write = KinesisIO.write().withAWSClientsProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED);
assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsModuleTest method testAWSStaticCredentialsProviderSerializationDeserialization.
@Test
public void testAWSStaticCredentialsProviderSerializationDeserialization() throws Exception {
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY));
String serializedCredentialsProvider = serialize(credentialsProvider);
AWSCredentialsProvider deserializedCredentialsProvider = deserializeCredentialsProvider(serializedCredentialsProvider);
checkStaticBasicCredentials(deserializedCredentialsProvider);
credentialsProvider = new AWSStaticCredentialsProvider(new BasicSessionCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY, SESSION_TOKEN));
checkStaticSessionCredentials(credentialsProvider);
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class BasicKinesisClientProviderTest method testSerialization.
@Test
public void testSerialization() {
AWSCredentialsProvider awsCredentialsProvider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY));
BasicKinesisProvider kinesisProvider = new BasicKinesisProvider(awsCredentialsProvider, Regions.AP_EAST_1, null, true);
byte[] serializedBytes = SerializableUtils.serializeToByteArray(kinesisProvider);
BasicKinesisProvider kinesisProviderDeserialized = (BasicKinesisProvider) SerializableUtils.deserializeFromByteArray(serializedBytes, "Basic Kinesis Provider");
assertEquals(kinesisProvider, kinesisProviderDeserialized);
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testReadWithCredentialsProvider.
@Test
public void testReadWithCredentialsProvider() {
Regions region = Regions.US_EAST_1;
AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
Read<KinesisRecord> read = KinesisIO.read().withAWSClientsProvider(credentialsProvider, region);
assertEquals(read.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, null, true));
}
Aggregations