Search in sources :

Example 1 with SSECustomerKey

use of org.apache.beam.sdk.io.aws2.s3.SSECustomerKey in project beam by apache.

the class AwsModuleTest method testSSECustomerKeySerializationDeserialization.

@Test
public void testSSECustomerKeySerializationDeserialization() throws Exception {
    // default key created by S3Options.SSECustomerKeyFactory
    SSECustomerKey emptyKey = SSECustomerKey.builder().build();
    assertThat(serializeAndDeserialize(emptyKey)).isEqualToComparingFieldByField(emptyKey);
    SSECustomerKey key = SSECustomerKey.builder().key("key").algorithm("algo").md5("md5").build();
    assertThat(serializeAndDeserialize(key)).isEqualToComparingFieldByField(key);
}
Also used : SSECustomerKey(org.apache.beam.sdk.io.aws2.s3.SSECustomerKey) Test(org.junit.Test)

Example 2 with SSECustomerKey

use of org.apache.beam.sdk.io.aws2.s3.SSECustomerKey in project beam by apache.

the class S3OptionsTest method testSetSSECustomerKey.

@Test
public void testSetSSECustomerKey() {
    S3Options options = create("--SSECustomerKey={\"key\": \"key\", \"algorithm\": \"algo\"}");
    SSECustomerKey expected = SSECustomerKey.builder().key("key").algorithm("algo").build();
    assertThat(options.getSSECustomerKey()).isEqualToComparingFieldByField(expected);
    assertThat(serializeDeserialize(options).getSSECustomerKey()).isEqualToComparingFieldByField(expected);
}
Also used : SSECustomerKey(org.apache.beam.sdk.io.aws2.s3.SSECustomerKey) Test(org.junit.Test)

Aggregations

SSECustomerKey (org.apache.beam.sdk.io.aws2.s3.SSECustomerKey)2 Test (org.junit.Test)2