@Test public void testCustomRegionAndPathStyleAccess() throws Exception { Config config = newConfig(); config.set("path_style_access", true); config.set("_command", BUCKET + "/" + KEY); when(taskRequest.getConfig()).thenReturn(config); when(s3Secrets.getSecretOptional("region")).thenReturn(Optional.of(REGION)); when(s3Client.getObjectMetadata(objectMetadataRequestCaptor.capture())).thenThrow(NOT_FOUND_EXCEPTION); Operator operator = factory.newOperator(newContext(projectPath, taskRequest)); try { operator.run(); fail(); } catch (TaskExecutionException ignore) { } verify(s3Client).setS3ClientOptions(s3ClientOptionsCaptor.capture()); S3ClientOptions s3ClientOptions = s3ClientOptionsCaptor.getValue(); assertThat(s3ClientOptions.isPathStyleAccess(), is(true)); verify(s3Client).setRegion(RegionUtils.getRegion(REGION)); }
@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);  }