use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class SqsIOWriteTest method testBuildWithCredentialsProviderAndRegionAndEndpoint.
@Test
public void testBuildWithCredentialsProviderAndRegionAndEndpoint() {
Region region = Region.US_EAST_1;
AwsCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create();
URI endpoint = URI.create("localhost:9999");
Write write = SqsIO.write().withSqsClientProvider(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 ClientConfigurationTest method testSerialization.
@Test
public void testSerialization() {
AwsCredentialsProvider credentials = StaticCredentialsProvider.create(AwsBasicCredentials.create("key", "secret"));
ClientConfiguration config = ClientConfiguration.builder().credentialsProvider(credentials).region(Region.US_WEST_1).endpoint(URI.create("https://localhost")).retry(b -> b.numRetries(3)).build();
byte[] serializedBytes = serializeToByteArray(config);
ClientConfiguration deserializedConfig = (ClientConfiguration) deserializeFromByteArray(serializedBytes, "ClientConfiguration");
assertThat(deserializedConfig).isEqualTo(config);
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class DynamoDBIOWriteTest 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 = DynamoDBIO.write().withDynamoDbClientProvider(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 BasicKinesisClientProviderTest method testSerialization.
@Test
public void testSerialization() {
AwsCredentialsProvider awsCredentialsProvider = StaticCredentialsProvider.create(AwsBasicCredentials.create("ACCESS_KEY_ID", "SECRET_ACCESS_KEY"));
BasicKinesisProvider kinesisProvider = new BasicKinesisProvider(awsCredentialsProvider, Region.AP_EAST_1, null);
byte[] serializedBytes = SerializableUtils.serializeToByteArray(kinesisProvider);
BasicKinesisProvider kinesisProviderDeserialized = (BasicKinesisProvider) SerializableUtils.deserializeFromByteArray(serializedBytes, "Basic Kinesis Provider");
assertEquals(kinesisProvider, kinesisProviderDeserialized);
}
use of software.amazon.awssdk.auth.credentials.AwsCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testBuildWithCredentialsProvider.
@Test
public void testBuildWithCredentialsProvider() {
Region region = Region.US_EAST_1;
AwsCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create();
Read read = KinesisIO.read().withAWSClientsProvider(credentialsProvider, region);
assertThat(read.getClientConfiguration()).isEqualTo(ClientConfiguration.create(credentialsProvider, region, null));
}
Aggregations