|
67 | 67 | import com.azure.storage.blob.specialized.BlockBlobClient; |
68 | 68 | import com.azure.storage.blob.specialized.PageBlobClient; |
69 | 69 | import com.azure.storage.blob.specialized.SpecializedBlobClientBuilder; |
| 70 | +import com.azure.storage.common.StorageSharedKeyCredential; |
70 | 71 | import com.azure.storage.common.Utility; |
71 | 72 | import com.azure.storage.common.implementation.Constants; |
72 | 73 | import com.azure.storage.common.policy.RequestRetryOptions; |
@@ -3186,4 +3187,64 @@ void containerNameEncodingOnGetBlobUrl() { |
3186 | 3187 | assertTrue(blobClient.getBlobUrl().contains(expectedEncodedContainerName)); |
3187 | 3188 | } |
3188 | 3189 |
|
| 3190 | + @Test |
| 3191 | + public void temporarySKUSupportTest() { |
| 3192 | + //test service, container, blobs |
| 3193 | + String standardGZRSAccountName = "seangzrs"; |
| 3194 | + //test service, container |
| 3195 | + String premiumZRSAccountName = "nickpremiumzrs"; |
| 3196 | + //test blobs |
| 3197 | + String premiumZRSBlockBlobAccountName = "nickblockblobpremiumzrs"; |
| 3198 | + //test service, container, blobs |
| 3199 | + String standardRAGZRSAccountName = "nickstandardragzrs"; |
| 3200 | + |
| 3201 | + String standardGZRSAccountKey |
| 3202 | + = ""; |
| 3203 | + String premiumZRSAccountKey |
| 3204 | + = ""; |
| 3205 | + String premiumZRSBlockBlobAccountKey |
| 3206 | + = ""; |
| 3207 | + String standardRAGZRSAccountKey |
| 3208 | + = ""; |
| 3209 | + |
| 3210 | + BlobServiceClient standardGZRSServiceClient = new BlobServiceClientBuilder() |
| 3211 | + .endpoint(String.format("https://%s.blob.core.windows.net", standardGZRSAccountName)) |
| 3212 | + .credential(new StorageSharedKeyCredential(standardGZRSAccountName, standardGZRSAccountKey)) |
| 3213 | + .buildClient(); |
| 3214 | + BlobServiceClient premiumZRSServiceClient = new BlobServiceClientBuilder() |
| 3215 | + .endpoint(String.format("https://%s.blob.core.windows.net", premiumZRSAccountName)) |
| 3216 | + .credential(new StorageSharedKeyCredential(premiumZRSAccountName, premiumZRSAccountKey)) |
| 3217 | + .buildClient(); |
| 3218 | + BlobServiceClient premiumZRSBlockBlobServiceClient = new BlobServiceClientBuilder() |
| 3219 | + .endpoint(String.format("https://%s.blob.core.windows.net", premiumZRSBlockBlobAccountName)) |
| 3220 | + .credential(new StorageSharedKeyCredential(premiumZRSBlockBlobAccountName, premiumZRSBlockBlobAccountKey)) |
| 3221 | + .buildClient(); |
| 3222 | + BlobServiceClient standardRAGZRSServiceClient = new BlobServiceClientBuilder() |
| 3223 | + .endpoint(String.format("https://%s.blob.core.windows.net", standardRAGZRSAccountName)) |
| 3224 | + .credential(new StorageSharedKeyCredential(standardRAGZRSAccountName, standardRAGZRSAccountKey)) |
| 3225 | + .buildClient(); |
| 3226 | + |
| 3227 | + assertDoesNotThrow(standardGZRSServiceClient::getAccountInfo); |
| 3228 | + assertDoesNotThrow( |
| 3229 | + () -> standardGZRSServiceClient.getBlobContainerClient(generateContainerName()).getAccountInfo(null)); |
| 3230 | + assertDoesNotThrow(() -> standardGZRSServiceClient.getBlobContainerClient(generateContainerName()) |
| 3231 | + .getBlobClient(generateBlobName()) |
| 3232 | + .getAccountInfo()); |
| 3233 | + |
| 3234 | + assertDoesNotThrow(premiumZRSServiceClient::getAccountInfo); |
| 3235 | + assertDoesNotThrow( |
| 3236 | + () -> premiumZRSServiceClient.getBlobContainerClient(generateContainerName()).getAccountInfo(null)); |
| 3237 | + |
| 3238 | + assertDoesNotThrow(() -> premiumZRSBlockBlobServiceClient.getBlobContainerClient(generateContainerName()) |
| 3239 | + .getBlobClient(generateBlobName()) |
| 3240 | + .getAccountInfo()); |
| 3241 | + |
| 3242 | + assertDoesNotThrow(standardRAGZRSServiceClient::getAccountInfo); |
| 3243 | + assertDoesNotThrow( |
| 3244 | + () -> standardRAGZRSServiceClient.getBlobContainerClient(generateContainerName()).getAccountInfo(null)); |
| 3245 | + assertDoesNotThrow(() -> standardRAGZRSServiceClient.getBlobContainerClient(generateContainerName()) |
| 3246 | + .getBlobClient(generateBlobName()) |
| 3247 | + .getAccountInfo()); |
| 3248 | + } |
| 3249 | + |
3189 | 3250 | } |
0 commit comments