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);
}
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);
}
Aggregations