bhaveshamre commented on code in PR #690:
URL: https://github.com/apache/ranger/pull/690#discussion_r2498304700


##########
hdfs-agent/src/test/java/org/apache/ranger/services/hdfs/client/HdfsClientTest.java:
##########
@@ -178,4 +208,326 @@ public void testValidHaConfig() throws 
IllegalArgumentException {
 
         HdfsClient.validateConnectionConfigs(configs);
     }
+
+    // ===== JUnit 5 additional tests appended (preserving existing code 
above) =====
+
+    @Test
+    public void test_validate_valid_multi_nn_transforms_config() {
+        Map<String, String> configs = new HashMap<>();
+        configs.put("username", "hdfsuser");
+        configs.put("password", "hdfsuser");
+        configs.put("hadoop.security.authentication", "simple");
+        configs.put("fs.default.name", 
"node-1.example.com:8020,node-2.example.com:8020");
+        HdfsClient.validateConnectionConfigs(configs);
+        Assertions.assertEquals("hdfscluster", 
configs.get("dfs.nameservices"));
+        Assertions.assertEquals("hdfs://hdfscluster", 
configs.get("fs.default.name"));
+        
Assertions.assertEquals("org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider",
 configs.get("dfs.client.failover.proxy.provider.hdfscluster"));
+        Assertions.assertEquals("namenode1,namenode2", 
configs.get("dfs.ha.namenodes.hdfscluster"));
+        Assertions.assertEquals("node-1.example.com:8020", 
configs.get("dfs.namenode.rpc-address.hdfscluster.namenode1"));
+        Assertions.assertEquals("node-2.example.com:8020", 
configs.get("dfs.namenode.rpc-address.hdfscluster.namenode2"));
+    }

Review Comment:
   code changes done.



-- 
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]

Reply via email to