diff --git a/storage/client/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy b/storage/client/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy index 858591ae1e2e5..f518c9731b9a7 100644 --- a/storage/client/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy +++ b/storage/client/src/test/java/com/azure/storage/blob/ServiceAPITest.groovy @@ -3,6 +3,7 @@ package com.azure.storage.blob +import com.azure.core.ServiceClient import com.azure.core.http.HttpHeaders import com.azure.core.http.rest.Response import com.azure.storage.blob.models.* @@ -304,7 +305,10 @@ class ServiceAPITest extends APISpec { def "Get stats"() { setup: - Response response = primaryServiceURL.getStatistics() + String secondaryEndpoint = String.format("https://%s-secondary.blob.core.windows.net", primaryCreds.accountName()) + StorageClient serviceClient = StorageClient.storageClientBuilder().endpoint(secondaryEndpoint) + .credential(primaryCreds).buildClient() + Response response = serviceClient.getStatistics() expect: response.headers().value("x-ms-version") != null @@ -315,8 +319,12 @@ class ServiceAPITest extends APISpec { } def "Get stats min"() { + setup: + String secondaryEndpoint = String.format("https://%s-secondary.blob.core.windows.net", primaryCreds.accountName()) + StorageClient serviceClient = StorageClient.storageClientBuilder().endpoint(secondaryEndpoint) + .credential(primaryCreds).buildClient() expect: - primaryServiceURL.getStatistics().statusCode() == 200 + serviceClient.getStatistics().statusCode() == 200 } def "Get stats error"() {