@Test public void testSSEC() throws Exception { Config config = newConfig(); config.set("_command", BUCKET + "/" + KEY); when(taskRequest.getConfig()).thenReturn(config); when(s3Secrets.getSecretOptional("sse_c_key")).thenReturn(Optional.of(SSE_C_KEY)); when(s3Client.getObjectMetadata(objectMetadataRequestCaptor.capture())).thenThrow(NOT_FOUND_EXCEPTION); Operator operator = factory.newOperator(newContext(projectPath, taskRequest)); try { operator.run(); fail(); } catch (TaskExecutionException ignore) { } GetObjectMetadataRequest objectMetadataRequest = objectMetadataRequestCaptor.getValue(); assertThat(objectMetadataRequest.getSSECustomerKey().getKey(), is(SSE_C_KEY)); assertThat(objectMetadataRequest.getSSECustomerKey().getAlgorithm(), is("AES256")); assertThat(objectMetadataRequest.getSSECustomerKey().getMd5(), is(nullValue())); }
@Override public Operator newOperator(OperatorContext context) { return new S3WaitOperator(context); }
S3WaitOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new S3WaitOperator(context); } }
S3WaitOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new S3WaitOperator(context); } @Inject  S3WaitOperatorFactory(@Environment Map<String, String> environment); @VisibleForTesting  S3WaitOperatorFactory(
            AmazonS3ClientFactory s3ClientFactory,
            Map<String, String> environment); }
S3WaitOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new S3WaitOperator(context); } @Inject  S3WaitOperatorFactory(@Environment Map<String, String> environment); @VisibleForTesting  S3WaitOperatorFactory(
            AmazonS3ClientFactory s3ClientFactory,
            Map<String, String> environment); String getType(); @Override Operator newOperator(OperatorContext context); }
S3WaitOperatorFactory implements OperatorFactory { @Override public Operator newOperator(OperatorContext context) { return new S3WaitOperator(context); } @Inject  S3WaitOperatorFactory(@Environment Map<String, String> environment); @VisibleForTesting  S3WaitOperatorFactory(
            AmazonS3ClientFactory s3ClientFactory,
            Map<String, String> environment); String getType(); @Override Operator newOperator(OperatorContext context);  }