Myasuka commented on code in PR #24372:
URL: https://github.com/apache/flink/pull/24372#discussion_r1505482621


##########
flink-filesystems/flink-gs-fs-hadoop/src/test/java/org/apache/flink/fs/gs/GSFileSystemFactoryTest.java:
##########
@@ -38,4 +44,31 @@ public void testOverrideStorageRootUrl() {
         String gsStorageClientHost = 
factory.getStorage().getOptions().getHost();
         assertEquals(gsStorageClientHost, "http://240.0.0.0:12345";);
     }
+
+    @Test
+    public void testSkipSensitiveConf() {
+        String secretKey = "secret";
+        String secretVal = "pass";
+
+        String notSecretKey = "a";
+        String notSecretval = "b";
+
+        Map<String, String> secret =
+                new HashMap<String, String>() {
+                    {
+                        put(secretKey, secretVal);
+                        put(notSecretKey, notSecretval);
+                    }
+                };
+
+        Configuration flinkConfig = Configuration.fromMap(secret);
+
+        GSFileSystemFactory factory = new GSFileSystemFactory();
+        Configuration res = factory.confHidingSensitiveValues(flinkConfig);
+        assertTrue(res.containsKey(secretKey));
+        assertFalse(Objects.equals(res.getString(secretKey, secretVal), 
secretVal));

Review Comment:
   I prefer to use `GlobalConfiguration#HIDDEN_CONTENT` to compare the result.



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