@@ -290,27 +290,32 @@ public void testAccountSpecificConfig() throws Exception {
290290 String defaultUri2 = this .getTestUrl ().replace (this .getAccountName (), accountName2 );
291291 String defaultUri3 = this .getTestUrl ().replace (this .getAccountName (), accountName3 );
292292
293- // Set account specific config for account 1
294- rawConfig .set (accountProperty (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , accountName1 ), TRUE_STR );
293+ // Set both account specific and account agnostic config for account 1
294+ rawConfig .set (accountProperty (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , accountName1 ), FALSE_STR );
295+ rawConfig .set (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , TRUE_STR );
295296 rawConfig .set (CommonConfigurationKeysPublic .FS_DEFAULT_NAME_KEY , defaultUri1 );
296297 AzureBlobFileSystem fs1 = (AzureBlobFileSystem ) FileSystem .newInstance (rawConfig );
298+ // Assert that account specific config takes precedence
299+ Assertions .assertThat (getIsNamespaceEnabled (fs1 )).describedAs (
300+ "getIsNamespaceEnabled should return true when the "
301+ + "account specific config is set as true" ).isFalse ();
297302
298- // Set account specific config for account 2
303+ // Set only the account specific config for account 2
299304 rawConfig .set (accountProperty (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , accountName2 ), FALSE_STR );
305+ rawConfig .unset (FS_AZURE_ACCOUNT_IS_HNS_ENABLED );
300306 rawConfig .set (CommonConfigurationKeysPublic .FS_DEFAULT_NAME_KEY , defaultUri2 );
301307 AzureBlobFileSystem fs2 = (AzureBlobFileSystem ) FileSystem .newInstance (rawConfig );
308+ // Assert that account specific config is enough.
309+ Assertions .assertThat (getIsNamespaceEnabled (fs2 )).describedAs (
310+ "getIsNamespaceEnabled should return true when the "
311+ + "account specific config is set as true" ).isFalse ();
302312
303- // Set account agnostic config for account 3
313+ // Set only account agnostic config for account 3
304314 rawConfig .set (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , FALSE_STR );
315+ rawConfig .unset (accountProperty (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , accountName3 ));
305316 rawConfig .set (CommonConfigurationKeysPublic .FS_DEFAULT_NAME_KEY , defaultUri3 );
306317 AzureBlobFileSystem fs3 = (AzureBlobFileSystem ) FileSystem .newInstance (rawConfig );
307-
308- Assertions .assertThat (getIsNamespaceEnabled (fs1 )).describedAs (
309- "getIsNamespaceEnabled should return true when the "
310- + "account specific config is set as true" ).isTrue ();
311- Assertions .assertThat (getIsNamespaceEnabled (fs2 )).describedAs (
312- "getIsNamespaceEnabled should return true when the "
313- + "account specific config is set as true" ).isFalse ();
318+ // Assert that account agnostic config is enough.
314319 Assertions .assertThat (getIsNamespaceEnabled (fs3 )).describedAs (
315320 "getIsNamespaceEnabled should return true when the "
316321 + "account specific config is not set" ).isFalse ();
0 commit comments