diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestWasbRemoteCallHelper.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestWasbRemoteCallHelper.java index 393dcfdd7c..8aad9e9ecf 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestWasbRemoteCallHelper.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestWasbRemoteCallHelper.java @@ -282,6 +282,8 @@ public void testFailureCodeJSONResponse() throws Throwable { @Test public void testWhenOneInstanceIsDown() throws Throwable { + boolean isAuthorizationCachingEnabled = fs.getConf().getBoolean(CachingAuthorizer.KEY_AUTH_SERVICE_CACHING_ENABLE, false); + // set up mocks HttpClient mockHttpClient = Mockito.mock(HttpClient.class); HttpEntity mockHttpEntity = Mockito.mock(HttpEntity.class); @@ -356,8 +358,9 @@ class HttpGetForServiceLocal extends ArgumentMatcher{ performop(mockHttpClient); - Mockito.verify(mockHttpClient, times(2)).execute(Mockito.argThat(new HttpGetForServiceLocal())); - Mockito.verify(mockHttpClient, times(2)).execute(Mockito.argThat(new HttpGetForService2())); + int expectedNumberOfInvocations = isAuthorizationCachingEnabled ? 1 : 2; + Mockito.verify(mockHttpClient, times(expectedNumberOfInvocations)).execute(Mockito.argThat(new HttpGetForServiceLocal())); + Mockito.verify(mockHttpClient, times(expectedNumberOfInvocations)).execute(Mockito.argThat(new HttpGetForService2())); } @Test diff --git a/hadoop-tools/hadoop-azure/src/test/resources/azure-test.xml b/hadoop-tools/hadoop-azure/src/test/resources/azure-test.xml index 8c88743c33..8cea256de8 100644 --- a/hadoop-tools/hadoop-azure/src/test/resources/azure-test.xml +++ b/hadoop-tools/hadoop-azure/src/test/resources/azure-test.xml @@ -29,10 +29,13 @@ --> - - fs.azure.secure.mode - true - + + fs.azure.user.agent.prefix