S3FileSystem extends FileSystem<S3ResourceId> { @VisibleForTesting CopyObjectResult atomicCopy( S3ResourceId sourcePath, S3ResourceId destinationPath, ObjectMetadata sourceObjectMetadata) throws AmazonClientException { CopyObjectRequest copyObjectRequest = new CopyObjectRequest( sourcePath.getBucket(), sourcePath.getKey(), destinationPath.getBucket(), destinationPath.getKey()); copyObjectRequest.setNewObjectMetadata(sourceObjectMetadata); copyObjectRequest.setStorageClass(options.getS3StorageClass()); copyObjectRequest.setSourceSSECustomerKey(options.getSSECustomerKey()); copyObjectRequest.setDestinationSSECustomerKey(options.getSSECustomerKey()); return amazonS3.get().copyObject(copyObjectRequest); } S3FileSystem(S3Options options);   }
@Test public void testAtomicCopy() { testAtomicCopy(s3Options()); testAtomicCopy(s3OptionsWithSSECustomerKey()); }