Search in sources :

Example 1 with Write

use of org.apache.beam.sdk.io.kinesis.KinesisIO.Write in project beam by apache.

the class KinesisIOWriteTest method testReadWithCredentialsProvider.

@Test
public void testReadWithCredentialsProvider() {
    Regions region = Regions.US_EAST_1;
    AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
    Write write = KinesisIO.write().withAWSClientsProvider(credentialsProvider, region);
    assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, null, true));
}
Also used : Write(org.apache.beam.sdk.io.kinesis.KinesisIO.Write) Regions(com.amazonaws.regions.Regions) AWSCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider) Test(org.junit.Test)

Example 2 with Write

use of org.apache.beam.sdk.io.kinesis.KinesisIO.Write in project beam by apache.

the class KinesisIOWriteTest method testReadWithBasicCredentialsAndCustomEndpoint.

@Test
public void testReadWithBasicCredentialsAndCustomEndpoint() {
    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);
    assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(new AWSStaticCredentialsProvider(credentials), region, customEndpoint, true));
}
Also used : Write(org.apache.beam.sdk.io.kinesis.KinesisIO.Write) AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) Regions(com.amazonaws.regions.Regions) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) Test(org.junit.Test)

Example 3 with Write

use of org.apache.beam.sdk.io.kinesis.KinesisIO.Write 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));
}
Also used : Write(org.apache.beam.sdk.io.kinesis.KinesisIO.Write) AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) Regions(com.amazonaws.regions.Regions) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) Test(org.junit.Test)

Example 4 with Write

use of org.apache.beam.sdk.io.kinesis.KinesisIO.Write in project beam by apache.

the class KinesisIOWriteTest method testReadWithCredentialsProviderAndVerificationDisabled.

@Test
public void testReadWithCredentialsProviderAndVerificationDisabled() {
    String customEndpoint = "localhost:9999";
    Regions region = Regions.US_WEST_1;
    AWSCredentialsProvider credentialsProvider = DefaultAWSCredentialsProviderChain.getInstance();
    Write write = KinesisIO.write().withAWSClientsProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED);
    assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(credentialsProvider, region, customEndpoint, VERIFICATION_DISABLED));
}
Also used : Write(org.apache.beam.sdk.io.kinesis.KinesisIO.Write) Regions(com.amazonaws.regions.Regions) AWSCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider) Test(org.junit.Test)

Example 5 with Write

use of org.apache.beam.sdk.io.kinesis.KinesisIO.Write in project beam by apache.

the class KinesisIOWriteTest method testReadWithBasicCredentials.

@Test
public void testReadWithBasicCredentials() {
    Regions region = Regions.US_EAST_1;
    Write write = KinesisIO.write().withAWSClientsProvider(ACCESS_KEY_ID, SECRET_KEY, region);
    assertEquals(write.getAWSClientsProvider(), new BasicKinesisProvider(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY)), region, null, true));
}
Also used : Write(org.apache.beam.sdk.io.kinesis.KinesisIO.Write) AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) Regions(com.amazonaws.regions.Regions) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) Test(org.junit.Test)

Aggregations

Regions (com.amazonaws.regions.Regions)6 Write (org.apache.beam.sdk.io.kinesis.KinesisIO.Write)6 Test (org.junit.Test)6 AWSCredentialsProvider (com.amazonaws.auth.AWSCredentialsProvider)3 AWSStaticCredentialsProvider (com.amazonaws.auth.AWSStaticCredentialsProvider)3 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)3