diff --git a/cdi-core/src/main/java/com/linkedin/cdi/source/S3SourceV2.java b/cdi-core/src/main/java/com/linkedin/cdi/source/S3SourceV2.java index 65034a6..f55d0e8 100644 --- a/cdi-core/src/main/java/com/linkedin/cdi/source/S3SourceV2.java +++ b/cdi-core/src/main/java/com/linkedin/cdi/source/S3SourceV2.java @@ -154,7 +154,8 @@ protected String getBucketName(JsonObject parameters, String host) { * * @param parameters JsonObject containing ms.source.s3.parameters * @param host hostname with bucket name in the beginning - * @return the endpoint name without the bucket name + * @return the endpoint name if bucket name is present in the parameters then removes the bucket name from host and + * calls the getEndpointFromHost method to get the endpoint. */ @VisibleForTesting protected String getEndpoint(JsonObject parameters, String host) { diff --git a/cdi-core/src/test/java/com/linkedin/cdi/source/S3SourceV2Test.java b/cdi-core/src/test/java/com/linkedin/cdi/source/S3SourceV2Test.java index 4d5a191..eb2a9f4 100644 --- a/cdi-core/src/test/java/com/linkedin/cdi/source/S3SourceV2Test.java +++ b/cdi-core/src/test/java/com/linkedin/cdi/source/S3SourceV2Test.java @@ -72,10 +72,10 @@ public void testEndpoint() { @Test public void testEndpointWithoutPeriod() { S3SourceV2 s3SourceV2 = new S3SourceV2(); - JsonObject parameteres = + JsonObject parameters = new Gson().fromJson("{\"region\" : \"us-east-2\", \"bucket_name\" : \"collect-us-west-2\"}", JsonObject.class); String host = "collect-us-west-2.s3.amazonaws.com"; - String endpoint = s3SourceV2.getEndpoint(parameteres, host); + String endpoint = s3SourceV2.getEndpoint(parameters, host); Assert.assertEquals(endpoint, "s3.amazonaws.com"); } }