abhishekagarwal87 commented on code in PR #15523:
URL: https://github.com/apache/druid/pull/15523#discussion_r1443225006


##########
extensions-core/azure-extensions/src/test/java/org/apache/druid/storage/azure/AzureStorageDruidModuleTest.java:
##########
@@ -303,6 +303,25 @@ public void testBothAccountKeyAndSAStokenUnset()
     );
   }
 
+  @Test
+  public void testGetAzureUtilsWithDefaultProperties()
+  {
+    Properties properties = initializePropertes();
+    AzureAccountConfig config = 
makeInjectorWithProperties(properties).getInstance(AzureAccountConfig.class);
+    String outputBlob = 
AzureUtils.maybeRemoveAzurePathPrefix("blob.core.windows.net/container/blob", 
config.getBlobStorageEndpoint());
+    Assert.assertEquals("container/blob", outputBlob);
+  }
+
+  @Test
+  public void testGetAzureUtilsWithDefaultCustomBlobPath()
+  {
+    Properties properties = initializePropertes();
+    properties.setProperty("druid.azure.endpointSuffix", 
"core.usgovcloudapi.net");
+    AzureAccountConfig config = 
makeInjectorWithProperties(properties).getInstance(AzureAccountConfig.class);
+    String outputBlob = 
AzureUtils.maybeRemoveAzurePathPrefix("blob.core.usgovcloudapi.net/container/blob",
 config.getBlobStorageEndpoint());
+    Assert.assertEquals("container/blob", outputBlob);

Review Comment:
   These tests should move to AzureUtilsTest. Here you can test that 
AzureAccountConfig is correctly initialized with the properties you are 
setting. And in AzureUtilsTest, you will add these tests but without creating 
an AzureAccountConfig object. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to