Skip to content

Commit

Permalink
Blob aadAudience Test Fix (#37347)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrandes authored Oct 24, 2023
1 parent 07b1a9a commit be5b190
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/storage/azure-storage-blob",
"Tag": "java/storage/azure-storage-blob_3ba5b9fd92"
"Tag": "java/storage/azure-storage-blob_c256787480"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2986,9 +2986,9 @@ public void storageAccountAudience() {

@Test
public void audienceError() {
BlobClient aadBlob = new BlobClientBuilder().endpoint(bc.getBlobUrl())
BlobClient aadBlob = instrument(new BlobClientBuilder().endpoint(bc.getBlobUrl())
.credential(new MockTokenCredential())
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience"))
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience")))
.buildClient();

BlobStorageException e = assertThrows(BlobStorageException.class, aadBlob::exists);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,10 +1244,10 @@ public void storageAccountAudience() {

@Test
public void audienceError() {
BlobServiceClient aadService = new BlobServiceClientBuilder()
BlobServiceClient aadService = instrument(new BlobServiceClientBuilder()
.endpoint(cc.getBlobContainerUrl())
.credential(new MockTokenCredential())
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience"))
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience")))
.buildClient();

BlobStorageException e = assertThrows(BlobStorageException.class, () -> aadService.getProperties());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@ public void storageAccountAudience() {

@Test
public void audienceError() {
AppendBlobClient aadBlob = new SpecializedBlobClientBuilder()
AppendBlobClient aadBlob = instrument(new SpecializedBlobClientBuilder()
.endpoint(bc.getBlobUrl())
.credential(new MockTokenCredential())
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience"))
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience")))
.buildAppendBlobClient();

BlobStorageException e = assertThrows(BlobStorageException.class, () -> aadBlob.exists());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2579,10 +2579,10 @@ public void storageAccountAudience() {

@Test
public void audienceError() {
BlockBlobClient aadBlob = new SpecializedBlobClientBuilder()
BlockBlobClient aadBlob = instrument(new SpecializedBlobClientBuilder()
.endpoint(blockBlobClient.getBlobUrl())
.credential(new MockTokenCredential())
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience"))
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience")))
.buildBlockBlobClient();

BlobStorageException e = assertThrows(BlobStorageException.class, () -> aadBlob.exists());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1663,10 +1663,10 @@ public void storageAccountAudience() {

@Test
public void audienceError() {
PageBlobClient aadBlob = new SpecializedBlobClientBuilder()
PageBlobClient aadBlob = instrument(new SpecializedBlobClientBuilder()
.endpoint(bc.getBlobUrl())
.credential(new MockTokenCredential())
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience"))
.audience(BlobAudience.createBlobServiceAccountAudience("badAudience")))
.buildPageBlobClient();

BlobStorageException e = assertThrows(BlobStorageException.class, () -> aadBlob.exists());
Expand Down

0 comments on commit be5b190

Please sign in to comment.