Skip to content

Commit dcc49df

Browse files
authored
Fixed issue in Resources that a fake token was not updated with a real one (#20814)
* Fixed issue in Resources that a fake token was not updated with a real one * Updated test runner of DataLakeStore. Returned dummy object as no need to return the instance of AdlsClientFactory. For configuration purpose only.
1 parent 10aaa3e commit dcc49df

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/DataLakeStore/DataLakeStore.Test/ScenarioTests/DataLakeStoreTestRunner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ protected DataLakeStoreTestRunner(ITestOutputHelper output)
5555
.WithRecordMatcher(
5656
(ignoreResourcesClient, resourceProviders, userAgentsToIgnore) => new UrlDecodingRecordMatcher(ignoreResourcesClient, resourceProviders, userAgentsToIgnore)
5757
)
58-
.WithMockContextAction(
59-
mockContext =>
58+
.WithManagementClients(mockContext =>
6059
{
6160
var currentEnvironment = TestEnvironmentFactory.GetTestEnvironment();
6261
AdlsClientFactory.IsTest = true;
6362
AdlsClientFactory.CustomDelegatingHAndler = mockContext.AddHandlers(currentEnvironment, new AdlMockDelegatingHandler());
6463
AdlsClientFactory.MockCredentials = currentEnvironment.TokenInfo[TokenAudience.Management];
64+
var dummyObj = new object();
65+
return dummyObj;
6566
}
6667
)
6768
.WithCleanupAction(

src/Resources/Resources.Test/ScenarioTests/ResourcesTestRunner.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected ResourcesTestRunner(ITestOutputHelper output)
5555
},
5656
resourceProviders: new Dictionary<string, string>()
5757
)
58-
.WithMockContextAction(mockContext =>
58+
.WithManagementClients(mockContext =>
5959
{
6060
var credentials = HttpMockServer.Mode != HttpRecorderMode.Playback
6161
? new Func<ServiceClientCredentials>(() =>
@@ -66,6 +66,7 @@ protected ResourcesTestRunner(ITestOutputHelper output)
6666
: new TokenCredentials("foo");
6767

6868
HttpClientHelperFactory.Instance = new TestHttpClientHelperFactory(credentials);
69+
return HttpClientHelperFactory.Instance;
6970
})
7071
.Build();
7172
}

0 commit comments

Comments
 (0)