steveloughran commented on a change in pull request #3041:
URL: https://github.com/apache/hadoop/pull/3041#discussion_r640540792



##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAccountConfiguration.java
##########
@@ -361,6 +375,37 @@ public void testAccessTokenProviderPrecedence()
     testGlobalAndAccountOAuthPrecedence(abfsConf, null, AuthType.OAuth);
   }
 
+  @Test
+  public void testConfigPropNotFound() throws Exception {
+    final String accountName = "account";
+
+    final Configuration conf = new Configuration();
+    final AbfsConfiguration abfsConf = new AbfsConfiguration(conf, 
accountName);
+
+    for (String key : CONFIG_KEYS) {
+      setAuthConfig(abfsConf, true, AuthType.OAuth);
+      abfsConf.unset(key + "." + accountName);
+      testMissingConfigKey(abfsConf, key);
+    }
+
+    unsetAuthConfig(abfsConf, false);
+    unsetAuthConfig(abfsConf, true);
+  }
+
+  private void testMissingConfigKey(final AbfsConfiguration abfsConf,
+      final String confKey) {
+    try {
+      abfsConf.getTokenProvider().getClass().getTypeName();

Review comment:
       Use LambdaTestUtils.intercept. 

##########
File path: 
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java
##########
@@ -402,6 +402,24 @@ public String getPasswordString(String key) throws 
IOException {
     return null;
   }
 
+  /**
+   * Returns a value for the key if the value exists and is not null.
+   * Otherwise, throws {@link ConfigurationPropertyNotFoundException} with
+   * key name.
+   *
+   * @param key Account-agnostic configuration key
+   * @return value if exists
+   * @throws IOException if error in fetching password or if value does not

Review comment:
       +mention ConfigurationPropertyNotFoundException for missing key

##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAccountConfiguration.java
##########
@@ -19,8 +19,16 @@
 package org.apache.hadoop.fs.azurebfs;
 
 import java.io.IOException;
-
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.hadoop.fs.azurebfs.contracts.exceptions

Review comment:
       usual losing battle on import isolation, split from non org.apache stuffl




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

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