use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testSystemPropertiesCredentialsProviderSerialization.
@Test
public void testSystemPropertiesCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new SystemPropertiesCredentialsProvider();
String expectedSerializedProvider = "{\"@type\":\"SystemPropertiesCredentialsProvider\"}";
String serializedProvider = serialize(credentialsProvider);
assertEquals(expectedSerializedProvider, serializedProvider);
assertEquals(expectedSerializedProvider, serialize(deserialize(serializedProvider)));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testEnvironmentVariableCredentialsProviderSerialization.
@Test
public void testEnvironmentVariableCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new EnvironmentVariableCredentialsProvider();
String expectedSerializedProvider = "{\"@type\":\"EnvironmentVariableCredentialsProvider\"}";
String serializedProvider = serialize(credentialsProvider);
assertEquals(expectedSerializedProvider, serializedProvider);
assertEquals(expectedSerializedProvider, serialize(deserialize(serializedProvider)));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testBasicCredentialsProviderSerialization.
@Test
public void testBasicCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY));
String serializedProvider = serialize(credentialsProvider);
checkStaticBasicCredentials(deserialize(serializedProvider));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testProfileCredentialsProviderSerialization.
@Test
public void testProfileCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new ProfileCredentialsProvider();
String expectedSerializedProvider = "{\"@type\":\"ProfileCredentialsProvider\"}";
String serializedProvider = serialize(credentialsProvider);
assertEquals(expectedSerializedProvider, serializedProvider);
assertEquals(expectedSerializedProvider, serialize(deserialize(serializedProvider)));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testReadWithCredentialsProviderAndCustomEndpoint.
@Test
public void testReadWithCredentialsProviderAndCustomEndpoint() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
Read<KinesisRecord> read = KinesisIO.read().withAWSClientsProvider(credentialsProvider, region, customEndpoint);
assertEquals(read.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, customEndpoint, true));
}
Aggregations