rakeshadr commented on code in PR #6787:
URL: https://github.com/apache/hadoop/pull/6787#discussion_r1617614794


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java:
##########
@@ -552,16 +552,7 @@ protected void assumeValidAuthConfigsPresent() {
         currentAuthType == AuthType.SAS);
     if (currentAuthType == AuthType.SharedKey) {
       assumeValidTestConfigPresent(getRawConfiguration(), 
FS_AZURE_ACCOUNT_KEY);
-    } else if (currentAuthType == AuthType.OAuth) {

Review Comment:
   @anujmodi2021 : Can you pls give a try to add the `testConfigPropNotFound` 
kinda unit test cases for the Oauth configs to make sure the source code 
validations are respected. Say, if someone tries to refactor 
getMandatoryPasswordString() to getPasswordString() function unknowingly, these 
unit test cases can make sure the behavior is retained by failing the test, 
isn't it?
   
   ```
             String authority = appendSlashIfNeeded(
                 getTrimmedPasswordString(FS_AZURE_ACCOUNT_OAUTH_MSI_AUTHORITY,
                 
AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_MSI_AUTHORITY));
             String tenantGuid =
                 getMandatoryPasswordString(FS_AZURE_ACCOUNT_OAUTH_MSI_TENANT);
             String clientId =
                 getMandatoryPasswordString(FS_AZURE_ACCOUNT_OAUTH_CLIENT_ID);
             String tokenFile =
                 getTrimmedPasswordString(FS_AZURE_ACCOUNT_OAUTH_TOKEN_FILE,
                 AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_TOKEN_FILE);
   ```
   
   Probably you can write the test cases into this test class.
   
https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAccountConfiguration.java#L377
   
   
   Secondly, I could see some interesting test cases 
`testGlobalAndAccountOAuthPrecedence`. Can you pls go through the class and add 
necessary test cases.
   
https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/TestAccountConfiguration.java#L405



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