use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class BasicSqsClientProviderTest method testSerialization.
@Test
public void testSerialization() {
AwsCredentialsProvider awsCredentialsProvider = StaticCredentialsProvider.create(AwsBasicCredentials.create("ACCESS_KEY_ID", "SECRET_ACCESS_KEY"));
BasicSqsClientProvider sqsClientProvider = new BasicSqsClientProvider(awsCredentialsProvider, "us-east-1", null);
byte[] serializedBytes = SerializableUtils.serializeToByteArray(sqsClientProvider);
BasicSqsClientProvider sqsClientProviderDeserialized = (BasicSqsClientProvider) SerializableUtils.deserializeFromByteArray(serializedBytes, "Aws Credentials Provider");
assertEquals(sqsClientProvider, sqsClientProviderDeserialized);
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class SqsIOWriteTest method testBuildWithCredentialsProviderAndRegion.
@Test
public void testBuildWithCredentialsProviderAndRegion() {
Region region = Region.US_EAST_1;
AwsCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create();
Write write = SqsIO.write().withSqsClientProvider(credentialsProvider, region.id());
assertThat(write.getClientConfiguration()).isEqualTo(ClientConfiguration.create(credentialsProvider, region, null));
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class SnsIOTest method testBuildWithCredentialsProviderAndRegionAndEndpoint.
@Test
public void testBuildWithCredentialsProviderAndRegionAndEndpoint() {
Region region = Region.US_EAST_1;
AwsCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create();
URI endpoint = URI.create("localhost:9999");
Write<Object> write = SnsIO.write().withSnsClientProvider(credentialsProvider, region.id(), endpoint);
assertThat(write.getClientConfiguration()).isEqualTo(ClientConfiguration.create(credentialsProvider, region, endpoint));
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class SqsIOReadTest method testBuildWithCredentialsProviderAndRegion.
@Test
public void testBuildWithCredentialsProviderAndRegion() {
Region region = Region.US_EAST_1;
AwsCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create();
Read read = SqsIO.read().withSqsClientProvider(credentialsProvider, region.id());
assertThat(read.clientConfiguration()).isEqualTo(ClientConfiguration.create(credentialsProvider, region, null));
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class BasicDynamoDbClientProviderTest method testSerialization.
@Test
public void testSerialization() {
AwsCredentialsProvider awsCredentialsProvider = StaticCredentialsProvider.create(AwsBasicCredentials.create("ACCESS_KEY_ID", "SECRET_ACCESS_KEY"));
BasicDynamoDbClientProvider dynamoDbClientProvider = new BasicDynamoDbClientProvider(awsCredentialsProvider, "us-east-1", null);
byte[] serializedBytes = SerializableUtils.serializeToByteArray(dynamoDbClientProvider);
BasicDynamoDbClientProvider dynamoDbClientProviderDeserialized = (BasicDynamoDbClientProvider) SerializableUtils.deserializeFromByteArray(serializedBytes, "Aws Credentials Provider");
assertEquals(dynamoDbClientProvider, dynamoDbClientProviderDeserialized);
}
Aggregations