@@ -354,30 +354,64 @@ public void testAccountSpecificConfig() throws Exception {
354354 */
355355 @ Test
356356 public void testNameSpaceConfig () throws Exception {
357- Configuration configuration = new Configuration ();
357+ Configuration configuration = getRawConfiguration ();
358358 configuration .unset (FS_AZURE_ACCOUNT_IS_HNS_ENABLED );
359+ configuration .unset (accountProperty (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , this .getAccountName ()));
360+ AzureBlobFileSystem abfs = (AzureBlobFileSystem ) FileSystem .newInstance (configuration );
359361 AbfsConfiguration abfsConfig = new AbfsConfiguration (configuration , "bogusAccountName" );
360362
361363 // Test that the namespace value when config is not set
362364 Assertions .assertThat (abfsConfig .getIsNamespaceEnabledAccount ())
363365 .describedAs ("Namespace enabled should be unknown in case config is not set" )
364366 .isEqualTo (Trilean .UNKNOWN );
365367
368+ // In case no namespace config is present, file system init calls getAcl() to determine account type.
369+ Assertions .assertThat (abfs .getIsNamespaceEnabled (getTestTracingContext (abfs , false )))
370+ .describedAs ("getIsNamespaceEnabled should return account type based on getAcl() call" )
371+ .isEqualTo (abfs .getAbfsClient ().getIsNamespaceEnabled ());
372+
373+ // In case no namespace config is present, file system init calls getAcl() to determine account type.
374+ Assertions .assertThat (abfs .getAbfsStore ().getAbfsConfiguration ().getIsNamespaceEnabledAccount ())
375+ .describedAs ("getIsNamespaceEnabled() should return updated account type based on getAcl() call" )
376+ .isNotEqualTo (Trilean .UNKNOWN );
377+
366378 configuration .set (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , TRUE_STR );
379+ abfs = (AzureBlobFileSystem ) FileSystem .newInstance (configuration );
367380 abfsConfig = new AbfsConfiguration (configuration , "bogusAccountName" );
368381
369382 // Test that the namespace enabled config is set correctly
370383 Assertions .assertThat (abfsConfig .getIsNamespaceEnabledAccount ())
371384 .describedAs ("Namespace enabled should be true in case config is set to true" )
372385 .isEqualTo (Trilean .TRUE );
373386
387+ // In case namespace config is present, same value will be return.
388+ Assertions .assertThat (abfs .getIsNamespaceEnabled (getTestTracingContext (abfs , false )))
389+ .describedAs ("getIsNamespaceEnabled() should return true when config is set to true" )
390+ .isEqualTo (true );
391+
392+ // In case namespace config is present, same value will be return.
393+ Assertions .assertThat (abfs .getAbfsClient ().getIsNamespaceEnabled ())
394+ .describedAs ("Client's getIsNamespaceEnabled() should return true when config is set to true" )
395+ .isEqualTo (true );
396+
374397 configuration .set (FS_AZURE_ACCOUNT_IS_HNS_ENABLED , FALSE_STR );
398+ abfs = (AzureBlobFileSystem ) FileSystem .newInstance (configuration );
375399 abfsConfig = new AbfsConfiguration (configuration , "bogusAccountName" );
376400
377401 // Test that the namespace enabled config is set correctly
378402 Assertions .assertThat (abfsConfig .getIsNamespaceEnabledAccount ())
379403 .describedAs ("Namespace enabled should be false in case config is set to false" )
380404 .isEqualTo (Trilean .FALSE );
405+
406+ // In case namespace config is present, same value will be return.
407+ Assertions .assertThat (abfs .getIsNamespaceEnabled (getTestTracingContext (abfs , false )))
408+ .describedAs ("getIsNamespaceEnabled() should return false when config is set to false" )
409+ .isEqualTo (false );
410+
411+ // In case namespace config is present, same value will be return.
412+ Assertions .assertThat (abfs .getAbfsClient ().getIsNamespaceEnabled ())
413+ .describedAs ("Client's getIsNamespaceEnabled() should return false when config is set to false" )
414+ .isEqualTo (false );
381415 }
382416
383417 private void assertFileSystemInitWithExpectedHNSSettings (
0 commit comments