Skip to content

Commit

Permalink
Fixed tests with wrong endpoint (#4222)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Jul 2, 2019
1 parent a9b37ab commit 666c18e
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -304,7 +305,10 @@ class ServiceAPITest extends APISpec {

def "Get stats"() {
setup:
Response<StorageServiceStats> 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<StorageServiceStats> response = serviceClient.getStatistics()

expect:
response.headers().value("x-ms-version") != null
Expand All @@ -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"() {
Expand Down

0 comments on commit 666c18e

Please sign in to comment.