use of com.amazonaws.auth.AWSStaticCredentialsProvider in project beam by apache.
the class KinesisIOWriteTest method testReadWithBasicCredentialsAndVerificationDisabled.
@Test
public void testReadWithBasicCredentialsAndVerificationDisabled() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
BasicAWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY);
Write write = KinesisIO.write().withAWSClientsProvider(ACCESS_KEY_ID, SECRET_KEY, region, customEndpoint, VERIFICATION_DISABLED);
assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(new AWSStaticCredentialsProvider(credentials), region, customEndpoint, VERIFICATION_DISABLED));
}
use of com.amazonaws.auth.AWSStaticCredentialsProvider 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.AWSStaticCredentialsProvider 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.AWSStaticCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testReadWithBasicCredentialsAndVerificationDisabled.
@Test
public void testReadWithBasicCredentialsAndVerificationDisabled() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
Read<KinesisRecord> read = KinesisIO.read().withAWSClientsProvider(ACCESS_KEY_ID, SECRET_ACCESS_KEY, region, customEndpoint, VERIFICATION_DISABLED);
assertEquals(read.getAWSClientsProvider(), new BasicKinesisProvider(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY)), region, customEndpoint, VERIFICATION_DISABLED));
}
use of com.amazonaws.auth.AWSStaticCredentialsProvider in project beam by apache.
the class KinesisIOReadTest method testReadWithBasicCredentialsAndCustomEndpoint.
@Test
public void testReadWithBasicCredentialsAndCustomEndpoint() {
String customEndpoint = "localhost:9999";
Regions region = Regions.US_WEST_1;
Read<KinesisRecord> read = KinesisIO.read().withAWSClientsProvider(ACCESS_KEY_ID, SECRET_ACCESS_KEY, region, customEndpoint);
assertEquals(read.getAWSClientsProvider(), new BasicKinesisProvider(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY)), region, customEndpoint, true));
}
Aggregations