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));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testReadWithCredentialsProviderAndVerificationDisabled.
@Test
public void testReadWithCredentialsProviderAndVerificationDisabled() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
Read<KinesisRecord> read = KinesisIO.read().withAWSClientsProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED);
assertEquals(read.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testStaticSessionCredentialsProviderSerialization.
@Test
public void testStaticSessionCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(new BasicSessionCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY, SESSION_TOKEN));
String serializedCredentials = serialize(credentialsProvider);
checkStaticSessionCredentials(deserialize(serializedCredentials));
}
use of com.amazonaws.auth.AWSCredentialsProvider in project beam by apache.
the class AwsSerializableUtilsTest method testEC2ContainerCredentialsProviderWrapperSerialization.
@Test
public void testEC2ContainerCredentialsProviderWrapperSerialization() {
AWSCredentialsProvider credentialsProvider = new EC2ContainerCredentialsProviderWrapper();
String expectedSerializedProvider = "{\"@type\":\"EC2ContainerCredentialsProviderWrapper\"}";
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 testClasspathPropertiesFileCredentialsProviderSerialization.
@Test
public void testClasspathPropertiesFileCredentialsProviderSerialization() {
AWSCredentialsProvider credentialsProvider = new ClasspathPropertiesFileCredentialsProvider("AwsCredentials.properties");
String expectedSerializedProvider = "{\"@type\":\"ClasspathPropertiesFileCredentialsProvider\",\"credentialsFilePath\":\"/AwsCredentials.properties\"}";
String serializedProvider = serialize(credentialsProvider);
assertEquals(expectedSerializedProvider, serializedProvider);
assertEquals(expectedSerializedProvider, serialize(deserialize(serializedProvider)));
}
Aggregations