|
@@ -246,21 +246,29 @@ public final class TestAbfsClient {
|
|
AbfsClient baseAbfsClientInstance,
|
|
AbfsClient baseAbfsClientInstance,
|
|
AbfsConfiguration abfsConfig)
|
|
AbfsConfiguration abfsConfig)
|
|
throws AzureBlobFileSystemException {
|
|
throws AzureBlobFileSystemException {
|
|
- AbfsPerfTracker tracker = new AbfsPerfTracker("test",
|
|
|
|
- abfsConfig.getAccountName(),
|
|
|
|
- abfsConfig);
|
|
|
|
-
|
|
|
|
- // Create test AbfsClient
|
|
|
|
- AbfsClient testClient = new AbfsClient(
|
|
|
|
- baseAbfsClientInstance.getBaseUrl(),
|
|
|
|
- new SharedKeyCredentials(abfsConfig.getAccountName().substring(0,
|
|
|
|
- abfsConfig.getAccountName().indexOf(DOT)),
|
|
|
|
- abfsConfig.getStorageAccountKey()),
|
|
|
|
- abfsConfig,
|
|
|
|
- new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
|
|
|
|
- abfsConfig.getTokenProvider(),
|
|
|
|
- tracker);
|
|
|
|
-
|
|
|
|
- return testClient;
|
|
|
|
- }
|
|
|
|
|
|
+ AuthType currentAuthType = abfsConfig.getAuthType(
|
|
|
|
+ abfsConfig.getAccountName());
|
|
|
|
+
|
|
|
|
+ AbfsPerfTracker tracker = new AbfsPerfTracker("test",
|
|
|
|
+ abfsConfig.getAccountName(),
|
|
|
|
+ abfsConfig);
|
|
|
|
+
|
|
|
|
+ // Create test AbfsClient
|
|
|
|
+ AbfsClient testClient = new AbfsClient(
|
|
|
|
+ baseAbfsClientInstance.getBaseUrl(),
|
|
|
|
+ (currentAuthType == AuthType.SharedKey
|
|
|
|
+ ? new SharedKeyCredentials(
|
|
|
|
+ abfsConfig.getAccountName().substring(0,
|
|
|
|
+ abfsConfig.getAccountName().indexOf(DOT)),
|
|
|
|
+ abfsConfig.getStorageAccountKey())
|
|
|
|
+ : null),
|
|
|
|
+ abfsConfig,
|
|
|
|
+ new ExponentialRetryPolicy(abfsConfig.getMaxIoRetries()),
|
|
|
|
+ (currentAuthType == AuthType.OAuth
|
|
|
|
+ ? abfsConfig.getTokenProvider()
|
|
|
|
+ : null),
|
|
|
|
+ tracker);
|
|
|
|
+
|
|
|
|
+ return testClient;
|
|
|
|
+ }
|
|
}
|
|
}
|