@Test public void testEndpoint() throws TranslatorException { WSConnection conn = Mockito.mock(WSConnection.class); S3ProcedureExecution s3ProcedureExecution = new S3ProcedureExecution(null, null, null, null, conn); assertEquals("https: Mockito.stub(conn.getEndPoint()).toReturn("http: s3ProcedureExecution = new S3ProcedureExecution(null, null, null, null, conn); assertEquals("http: }
protected String determineEndpoint(String name, String bucket, String region) throws TranslatorException { if (endpoint != null) { return endpoint; } if (bucket == null) { throw new TranslatorException(S3ExecutionFactory.UTIL.gs("no_bucket")); } if (baseEndpoint != null) { endpoint = baseEndpoint; } else if (region.equalsIgnoreCase(S3ExecutionFactory.US_EAST_1)) { endpoint = AWS_S3_URL_PREFIX + AWS_S3_HOSTHAME; } else { endpoint = AWS_S3_URL_PREFIX + region + "." + AWS_S3_HOSTHAME; } endpoint += ((!endpoint.endsWith("/")?"/":"") + bucket + "/" + name); return endpoint; }
S3ProcedureExecution implements ProcedureExecution { protected String determineEndpoint(String name, String bucket, String region) throws TranslatorException { if (endpoint != null) { return endpoint; } if (bucket == null) { throw new TranslatorException(S3ExecutionFactory.UTIL.gs("no_bucket")); } if (baseEndpoint != null) { endpoint = baseEndpoint; } else if (region.equalsIgnoreCase(S3ExecutionFactory.US_EAST_1)) { endpoint = AWS_S3_URL_PREFIX + AWS_S3_HOSTHAME; } else { endpoint = AWS_S3_URL_PREFIX + region + "." + AWS_S3_HOSTHAME; } endpoint += ((!endpoint.endsWith("/")?"/":"") + bucket + "/" + name); return endpoint; } }
S3ProcedureExecution implements ProcedureExecution { protected String determineEndpoint(String name, String bucket, String region) throws TranslatorException { if (endpoint != null) { return endpoint; } if (bucket == null) { throw new TranslatorException(S3ExecutionFactory.UTIL.gs("no_bucket")); } if (baseEndpoint != null) { endpoint = baseEndpoint; } else if (region.equalsIgnoreCase(S3ExecutionFactory.US_EAST_1)) { endpoint = AWS_S3_URL_PREFIX + AWS_S3_HOSTHAME; } else { endpoint = AWS_S3_URL_PREFIX + region + "." + AWS_S3_HOSTHAME; } endpoint += ((!endpoint.endsWith("/")?"/":"") + bucket + "/" + name); return endpoint; } S3ProcedureExecution(Call command, S3ExecutionFactory ef, RuntimeMetadata metadata, ExecutionContext ec,
            WSConnection conn); }
S3ProcedureExecution implements ProcedureExecution { protected String determineEndpoint(String name, String bucket, String region) throws TranslatorException { if (endpoint != null) { return endpoint; } if (bucket == null) { throw new TranslatorException(S3ExecutionFactory.UTIL.gs("no_bucket")); } if (baseEndpoint != null) { endpoint = baseEndpoint; } else if (region.equalsIgnoreCase(S3ExecutionFactory.US_EAST_1)) { endpoint = AWS_S3_URL_PREFIX + AWS_S3_HOSTHAME; } else { endpoint = AWS_S3_URL_PREFIX + region + "." + AWS_S3_HOSTHAME; } endpoint += ((!endpoint.endsWith("/")?"/":"") + bucket + "/" + name); return endpoint; } S3ProcedureExecution(Call command, S3ExecutionFactory ef, RuntimeMetadata metadata, ExecutionContext ec,
            WSConnection conn); @Override void execute(); @Override void close(); @Override void cancel(); @Override List<?> next(); @Override List<?> getOutputParameterValues(); }
S3ProcedureExecution implements ProcedureExecution { protected String determineEndpoint(String name, String bucket, String region) throws TranslatorException { if (endpoint != null) { return endpoint; } if (bucket == null) { throw new TranslatorException(S3ExecutionFactory.UTIL.gs("no_bucket")); } if (baseEndpoint != null) { endpoint = baseEndpoint; } else if (region.equalsIgnoreCase(S3ExecutionFactory.US_EAST_1)) { endpoint = AWS_S3_URL_PREFIX + AWS_S3_HOSTHAME; } else { endpoint = AWS_S3_URL_PREFIX + region + "." + AWS_S3_HOSTHAME; } endpoint += ((!endpoint.endsWith("/")?"/":"") + bucket + "/" + name); return endpoint; } S3ProcedureExecution(Call command, S3ExecutionFactory ef, RuntimeMetadata metadata, ExecutionContext ec,
            WSConnection conn); @Override void execute(); @Override void close(); @Override void cancel(); @Override List<?> next(); @Override List<?> getOutputParameterValues();  }