Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests for Container, Queue, and FileSystem Get/Set ACLs and Get… #47892

Open
wants to merge 1 commit into
base: feature/storage/stg98base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Blobs/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Blobs",
"Tag": "net/storage/Azure.Storage.Blobs_4d91c5bf9c"
"Tag": "net/storage/Azure.Storage.Blobs_8ad7925e46"
}
25 changes: 25 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/tests/ContainerClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,19 @@ await TestHelper.AssertExpectedExceptionAsync<RequestFailedException>(
e => Assert.AreEqual("ContainerNotFound", e.ErrorCode));
}

[RecordedTest]
[ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2025_07_05)]
public async Task GetSetAccessPolicyAsync_OAuth()
{
// Arrange
BlobServiceClient service = GetServiceClient_OAuth();
await using DisposingContainer test = await GetTestContainerAsync(service);

// Act
Response<BlobContainerAccessPolicy> response = await test.Container.GetAccessPolicyAsync();
await test.Container.SetAccessPolicyAsync(permissions: response.Value.SignedIdentifiers);
}

[RecordedTest]
public async Task SetAccessPolicyAsync()
{
Expand Down Expand Up @@ -4322,6 +4335,18 @@ await TestHelper.AssertExpectedExceptionAsync<RequestFailedException>(
e => Assert.AreEqual("NoAuthenticationInformation", e.ErrorCode));
}

[RecordedTest]
[ServiceVersion(Min = BlobClientOptions.ServiceVersion.V2025_07_05)]
public async Task GetAccountInfoAsync_OAuth()
{
// Arrange
BlobServiceClient service = GetServiceClient_OAuth();
await using DisposingContainer test = await GetTestContainerAsync(service);

// Act
await test.Container.GetAccountInfoAsync();
}

[RecordedTest]
public void CanMockClientConstructors()
{
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Files.DataLake/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Files.DataLake",
"Tag": "net/storage/Azure.Storage.Files.DataLake_d74597f1e3"
"Tag": "net/storage/Azure.Storage.Files.DataLake_2832248f4e"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,19 @@ await TestHelper.AssertExpectedExceptionAsync<RequestFailedException>(
e => Assert.AreEqual("LeaseNotPresentWithContainerOperation", e.ErrorCode));
}

[RecordedTest]
[ServiceVersion(Min = DataLakeClientOptions.ServiceVersion.V2025_07_05)]
public async Task GetSetAccesPolicy_OAuth()
{
// Arrange
DataLakeServiceClient service = GetServiceClient_OAuth();
await using DisposingFileSystem test = await GetNewFileSystem(service);

// Act
Response<FileSystemAccessPolicy> response = await test.FileSystem.GetAccessPolicyAsync();
await test.FileSystem.SetAccessPolicyAsync(permissions: response.Value.SignedIdentifiers);
}

[RecordedTest]
public async Task SetAccessPolicyAsync()
{
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Queues/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Queues",
"Tag": "net/storage/Azure.Storage.Queues_ef3164e0b2"
"Tag": "net/storage/Azure.Storage.Queues_814b65165a"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public QueueClientTestFixtureAttribute(params object[] additionalParameters)
},
additionalParameters: additionalParameters)
{
RecordingServiceVersion = StorageVersionExtensions.LatestVersion;
RecordingServiceVersion = StorageVersionExtensions.MaxVersion;
LiveServiceVersions = new object[] { StorageVersionExtensions.LatestVersion, };
}
}
Expand Down
13 changes: 13 additions & 0 deletions sdk/storage/Azure.Storage.Queues/tests/QueueClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,19 @@ await TestHelper.AssertExpectedExceptionAsync<RequestFailedException>(
actualException => Assert.AreEqual("QueueNotFound", actualException.ErrorCode));
}

[RecordedTest]
[ServiceVersion(Min = QueueClientOptions.ServiceVersion.V2025_07_05)]
public async Task GetSetAccessPolicyAsync_OAuth()
{
// Arrange
QueueServiceClient service = GetServiceClient_OAuth();
await using DisposingQueue test = await GetTestQueueAsync(service);

// Act
Response<IEnumerable<QueueSignedIdentifier>> response = await test.Queue.GetAccessPolicyAsync();
await test.Queue.SetAccessPolicyAsync(permissions: response.Value);
}

[RecordedTest]
public async Task SetAccessPolicyAsync()
{
Expand Down
Loading