add request id in return types (#1395)

* add request id in return types

* changelog

* fix bug
This commit is contained in:
JinmingHu 2021-01-19 10:54:38 +08:00 committed by GitHub
parent 57e6e8dbba
commit c2d26ddb35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 327 additions and 97 deletions

View File

@ -2,6 +2,13 @@
## 12.0.0-beta.7 (Unreleased)
### New Features
- Added `RequestId` in API return types.
### Breaking Changes
- `UserDelegationKey` was changed to a member of `GetUserDelegationKeyResult` rather than a typedef like before.
## 12.0.0-beta.6 (2020-01-14)

View File

@ -11,8 +11,6 @@
namespace Azure { namespace Storage { namespace Blobs { namespace Models {
using UserDelegationKey = GetUserDelegationKeyResult;
struct DownloadBlobToResult
{
std::string ETag;

View File

@ -111,6 +111,7 @@ namespace Azure { namespace Storage { namespace Blobs {
&& e.ErrorCode == "BlobAlreadyExists")
{
Models::CreateAppendBlobResult ret;
ret.RequestId = e.RequestId;
ret.Created = false;
return Azure::Core::Response<Models::CreateAppendBlobResult>(std::move(ret), std::move(e.RawResponse));
}

View File

@ -633,6 +633,7 @@ namespace Azure { namespace Storage { namespace Blobs {
&& (e.ErrorCode == "BlobNotFound" || e.ErrorCode == "ContainerNotFound"))
{
Models::DeleteBlobResult ret;
ret.RequestId = e.RequestId;
ret.Deleted = false;
return Azure::Core::Response<Models::DeleteBlobResult>(std::move(ret), std::move(e.RawResponse));
}

View File

@ -164,6 +164,7 @@ namespace Azure { namespace Storage { namespace Blobs {
&& e.ErrorCode == "ContainerAlreadyExists")
{
Models::CreateBlobContainerResult ret;
ret.RequestId = e.RequestId;
ret.Created = false;
return Azure::Core::Response<Models::CreateBlobContainerResult>(
std::move(ret), std::move(e.RawResponse));
@ -196,6 +197,7 @@ namespace Azure { namespace Storage { namespace Blobs {
&& e.ErrorCode == "ContainerNotFound")
{
Models::DeleteBlobContainerResult ret;
ret.RequestId = e.RequestId;
ret.Deleted = false;
return Azure::Core::Response<Models::DeleteBlobContainerResult>(
std::move(ret), std::move(e.RawResponse));

View File

@ -118,6 +118,7 @@ namespace Azure { namespace Storage { namespace Blobs {
&& e.ErrorCode == "BlobAlreadyExists")
{
Models::CreatePageBlobResult ret;
ret.RequestId = e.RequestId;
ret.Created = false;
return Azure::Core::Response<Models::CreatePageBlobResult>(
std::move(ret), std::move(e.RawResponse));

View File

@ -43,6 +43,7 @@ namespace Azure { namespace Storage { namespace Test {
auto appendBlobClient = Azure::Storage::Blobs::AppendBlobClient::CreateFromConnectionString(
StandardStorageConnectionString(), m_containerName, RandomString());
auto blobContentInfo = appendBlobClient.Create(m_blobUploadOptions);
EXPECT_FALSE(blobContentInfo->RequestId.empty());
EXPECT_FALSE(blobContentInfo->ETag.empty());
EXPECT_TRUE(IsValidTime(blobContentInfo->LastModified));
EXPECT_TRUE(blobContentInfo->VersionId.HasValue());
@ -51,13 +52,15 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(blobContentInfo->EncryptionKeySha256.HasValue());
auto properties = *appendBlobClient.GetProperties();
EXPECT_FALSE(properties.RequestId.empty());
EXPECT_TRUE(properties.CommittedBlockCount.HasValue());
EXPECT_EQ(properties.CommittedBlockCount.GetValue(), 0);
EXPECT_EQ(properties.ContentLength, 0);
auto blockContent
= Azure::Core::Http::MemoryBodyStream(m_blobContent.data(), m_blobContent.size());
appendBlobClient.AppendBlock(&blockContent);
auto appendResponse = appendBlobClient.AppendBlock(&blockContent);
EXPECT_FALSE(appendResponse->RequestId.empty());
properties = *appendBlobClient.GetProperties();
EXPECT_EQ(properties.CommittedBlockCount.GetValue(), 1);
EXPECT_EQ(properties.ContentLength, static_cast<int64_t>(m_blobContent.size()));
@ -88,7 +91,9 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(
properties.ContentLength, static_cast<int64_t>(originalLength + m_blobContent.size()));
appendBlobClient.Delete();
auto deleteResponse = appendBlobClient.Delete();
EXPECT_TRUE(deleteResponse->Deleted);
EXPECT_FALSE(deleteResponse->RequestId.empty());
EXPECT_THROW(appendBlobClient.Delete(), StorageException);
}
@ -284,6 +289,7 @@ namespace Azure { namespace Storage { namespace Test {
sealOptions.AccessConditions.IfAppendPositionEqual = m_blobContent.size();
auto sealResult = blobClient.Seal(sealOptions);
EXPECT_FALSE(sealResult->RequestId.empty());
EXPECT_FALSE(sealResult->ETag.empty());
EXPECT_TRUE(IsValidTime(sealResult->LastModified));
EXPECT_TRUE(sealResult->IsSealed);
@ -340,6 +346,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_THROW(blobClientWithoutAuth.CreateIfNotExists(), StorageException);
{
auto response = blobClient.CreateIfNotExists();
EXPECT_FALSE(response->RequestId.empty());
EXPECT_TRUE(response->Created);
}
auto blobContent
@ -347,6 +354,7 @@ namespace Azure { namespace Storage { namespace Test {
blobClient.AppendBlock(&blobContent);
{
auto response = blobClient.CreateIfNotExists();
EXPECT_FALSE(response->RequestId.empty());
EXPECT_FALSE(response->Created);
}
auto downloadStream = std::move(blobClient.Download()->BodyStream);

View File

@ -60,7 +60,9 @@ namespace Azure { namespace Storage { namespace Test {
metadata["key2"] = "TWO";
options.Metadata = metadata;
auto res = container_client.Create(options);
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_EQ(res->RequestId, res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId));
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
EXPECT_FALSE(res->ETag.empty());
@ -68,7 +70,9 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_THROW(container_client.Create(), StorageException);
auto res2 = container_client.Delete();
EXPECT_FALSE(res2->RequestId.empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_EQ(res2->RequestId, res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId));
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -80,10 +84,12 @@ namespace Azure { namespace Storage { namespace Test {
{
auto response = container_client.DeleteIfExists();
EXPECT_FALSE(response->Deleted);
EXPECT_FALSE(response->RequestId.empty());
}
{
auto response = container_client.CreateIfNotExists();
EXPECT_TRUE(response->Created);
EXPECT_FALSE(response->RequestId.empty());
}
{
auto response = container_client.CreateIfNotExists();
@ -101,6 +107,7 @@ namespace Azure { namespace Storage { namespace Test {
metadata["key1"] = "one";
metadata["key2"] = "TWO";
auto res = m_blobContainerClient->SetMetadata(metadata);
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -108,6 +115,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(IsValidTime(res->LastModified));
auto res2 = m_blobContainerClient->GetProperties();
EXPECT_FALSE(res2->RequestId.empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -164,6 +172,7 @@ namespace Azure { namespace Storage { namespace Test {
do
{
auto res = m_blobContainerClient->ListBlobsSinglePage(options);
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -251,6 +260,7 @@ namespace Azure { namespace Storage { namespace Test {
while (true)
{
auto res = m_blobContainerClient->ListBlobsByHierarchySinglePage(delimiter, options);
EXPECT_FALSE(res->RequestId.empty());
EXPECT_EQ(res->Delimiter, delimiter);
EXPECT_EQ(res->Prefix, options.Prefix.GetValue());
EXPECT_TRUE(res->Items.empty());
@ -324,6 +334,7 @@ namespace Azure { namespace Storage { namespace Test {
do
{
auto res = m_blobContainerClient->ListBlobsSinglePage(options);
EXPECT_FALSE(res->RequestId.empty());
options.ContinuationToken = res->ContinuationToken;
for (const auto& blob : res->Items)
{
@ -387,10 +398,12 @@ namespace Azure { namespace Storage { namespace Test {
options.SignedIdentifiers.emplace_back(identifier);
auto ret = container_client.SetAccessPolicy(options);
EXPECT_FALSE(ret->RequestId.empty());
EXPECT_FALSE(ret->ETag.empty());
EXPECT_TRUE(IsValidTime(ret->LastModified));
auto ret2 = container_client.GetAccessPolicy();
EXPECT_FALSE(ret2->RequestId.empty());
EXPECT_EQ(ret2->ETag, ret->ETag);
EXPECT_EQ(ret2->LastModified, ret->LastModified);
EXPECT_EQ(ret2->AccessType, options.AccessType.GetValue());
@ -404,10 +417,12 @@ namespace Azure { namespace Storage { namespace Test {
std::string leaseId1 = CreateUniqueLeaseId();
int32_t leaseDuration = 20;
auto aLease = *m_blobContainerClient->AcquireLease(leaseId1, leaseDuration);
EXPECT_FALSE(aLease.RequestId.empty());
EXPECT_FALSE(aLease.ETag.empty());
EXPECT_TRUE(IsValidTime(aLease.LastModified));
EXPECT_EQ(aLease.LeaseId, leaseId1);
aLease = *m_blobContainerClient->AcquireLease(leaseId1, leaseDuration);
EXPECT_FALSE(aLease.RequestId.empty());
EXPECT_FALSE(aLease.ETag.empty());
EXPECT_TRUE(IsValidTime(aLease.LastModified));
EXPECT_EQ(aLease.LeaseId, leaseId1);
@ -418,6 +433,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(properties.LeaseDuration.GetValue().empty());
auto rLease = *m_blobContainerClient->RenewLease(leaseId1);
EXPECT_FALSE(rLease.RequestId.empty());
EXPECT_FALSE(rLease.ETag.empty());
EXPECT_TRUE(IsValidTime(rLease.LastModified));
EXPECT_EQ(rLease.LeaseId, leaseId1);
@ -425,11 +441,13 @@ namespace Azure { namespace Storage { namespace Test {
std::string leaseId2 = CreateUniqueLeaseId();
EXPECT_NE(leaseId1, leaseId2);
auto cLease = *m_blobContainerClient->ChangeLease(leaseId1, leaseId2);
EXPECT_FALSE(cLease.RequestId.empty());
EXPECT_FALSE(cLease.ETag.empty());
EXPECT_TRUE(IsValidTime(cLease.LastModified));
EXPECT_EQ(cLease.LeaseId, leaseId2);
auto containerInfo = *m_blobContainerClient->ReleaseLease(leaseId2);
EXPECT_FALSE(containerInfo.RequestId.empty());
EXPECT_FALSE(containerInfo.ETag.empty());
EXPECT_TRUE(IsValidTime(containerInfo.LastModified));

View File

@ -52,7 +52,7 @@ namespace Azure { namespace Storage { namespace Test {
serviceUrl,
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto userDelegationKey = *blobServiceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn);
auto userDelegationKey = blobServiceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn)->Key;
auto verify_blob_read = [&](const std::string& sas) {
EXPECT_NO_THROW(blobClient0.Create());

View File

@ -3,6 +3,7 @@
#include <thread>
#include <azure/identity/client_secret_credential.hpp>
#include <azure/storage/blobs.hpp>
#include "test_base.hpp"
@ -112,6 +113,7 @@ namespace Azure { namespace Storage { namespace Test {
do
{
auto res = m_blobServiceClient.ListBlobContainersSinglePage(options);
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -167,6 +169,7 @@ namespace Azure { namespace Storage { namespace Test {
TEST_F(BlobServiceClientTest, GetProperties)
{
auto ret = m_blobServiceClient.GetProperties();
EXPECT_FALSE(ret->RequestId.empty());
auto properties = *ret;
auto logging = properties.Logging;
EXPECT_FALSE(logging.Version.empty());
@ -312,12 +315,14 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(downloadedProperties.DeleteRetentionPolicy, properties.DeleteRetentionPolicy);
m_blobServiceClient.SetProperties(originalProperties);
auto res = m_blobServiceClient.SetProperties(originalProperties);
EXPECT_FALSE(res->RequestId.empty());
}
TEST_F(BlobServiceClientTest, AccountInfo)
{
auto accountInfo = *m_blobServiceClient.GetAccountInfo();
EXPECT_FALSE(accountInfo.RequestId.empty());
EXPECT_FALSE(accountInfo.SkuName.Get().empty());
EXPECT_FALSE(accountInfo.AccountKind.Get().empty());
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
@ -337,6 +342,7 @@ namespace Azure { namespace Storage { namespace Test {
auto secondaryServiceClient
= Blobs::BlobServiceClient(InferSecondaryUrl(m_blobServiceClient.GetUrl()), keyCredential);
auto serviceStatistics = *secondaryServiceClient.GetStatistics();
EXPECT_FALSE(serviceStatistics.RequestId.empty());
EXPECT_FALSE(serviceStatistics.GeoReplication.Status.Get().empty());
if (serviceStatistics.GeoReplication.LastSyncedOn.HasValue())
{
@ -417,4 +423,29 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_NO_THROW(containerClient2.GetProperties());
}
TEST_F(BlobServiceClientTest, UserDelegationKey)
{
auto sasStartsOn = std::chrono::system_clock::now() - std::chrono::minutes(5);
auto sasExpiresOn = std::chrono::system_clock::now() + std::chrono::minutes(60);
auto blobServiceClient1 = Blobs::BlobServiceClient(
m_blobServiceClient.GetUrl(),
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto getUserDelegationKeyResult
= blobServiceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn);
EXPECT_FALSE(getUserDelegationKeyResult->RequestId.empty());
auto userDelegationKey = getUserDelegationKeyResult->Key;
EXPECT_FALSE(userDelegationKey.SignedObjectId.empty());
EXPECT_FALSE(userDelegationKey.SignedTenantId.empty());
EXPECT_TRUE(IsValidTime(userDelegationKey.SignedStartsOn));
EXPECT_TRUE(IsValidTime(userDelegationKey.SignedExpiresOn));
EXPECT_FALSE(userDelegationKey.SignedService.empty());
EXPECT_FALSE(userDelegationKey.SignedVersion.empty());
EXPECT_FALSE(userDelegationKey.Value.empty());
}
}}} // namespace Azure::Storage::Test

View File

@ -65,6 +65,7 @@ namespace Azure { namespace Storage { namespace Test {
auto blobContent
= Azure::Core::Http::MemoryBodyStream(m_blobContent.data(), m_blobContent.size());
auto blobContentInfo = blockBlobClient.Upload(&blobContent, m_blobUploadOptions);
EXPECT_FALSE(blobContentInfo->RequestId.empty());
EXPECT_FALSE(blobContentInfo->ETag.empty());
EXPECT_TRUE(IsValidTime(blobContentInfo->LastModified));
EXPECT_TRUE(blobContentInfo->VersionId.HasValue());
@ -79,6 +80,7 @@ namespace Azure { namespace Storage { namespace Test {
TEST_F(BlockBlobClientTest, UploadDownload)
{
auto res = m_blockBlobClient->Download();
EXPECT_FALSE(res->RequestId.empty());
EXPECT_EQ(res->BlobSize, static_cast<int64_t>(m_blobContent.size()));
EXPECT_EQ(res->ContentRange.Offset, 0);
EXPECT_EQ(res->ContentRange.Length.GetValue(), static_cast<int64_t>(m_blobContent.size()));
@ -176,7 +178,7 @@ namespace Azure { namespace Storage { namespace Test {
{
auto blobClient = m_blobContainerClient->GetBlobClient(RandomString());
auto res = blobClient.StartCopyFromUri(m_blockBlobClient->GetUrl());
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -204,6 +206,7 @@ namespace Azure { namespace Storage { namespace Test {
TEST_F(BlockBlobClientTest, SnapShotVersions)
{
auto res = m_blockBlobClient->CreateSnapshot();
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -258,6 +261,7 @@ namespace Azure { namespace Storage { namespace Test {
blockBlobClient.SetHttpHeaders(m_blobUploadOptions.HttpHeaders);
auto res = blockBlobClient.GetProperties();
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());
@ -293,6 +297,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(blobContentInfo->VersionId.HasValue());
EXPECT_FALSE(blobContentInfo->VersionId.GetValue().empty());
auto res = blockBlobClient.GetBlockList();
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(Details::HttpHeaderXMsVersion).empty());

View File

@ -49,6 +49,7 @@ namespace Azure { namespace Storage { namespace Test {
auto pageBlobClient = Azure::Storage::Blobs::PageBlobClient::CreateFromConnectionString(
StandardStorageConnectionString(), m_containerName, RandomString());
auto blobContentInfo = pageBlobClient.Create(0, m_blobUploadOptions);
EXPECT_FALSE(blobContentInfo->RequestId.empty());
EXPECT_FALSE(blobContentInfo->ETag.empty());
EXPECT_TRUE(IsValidTime(blobContentInfo->LastModified));
EXPECT_TRUE(blobContentInfo->VersionId.HasValue());
@ -98,6 +99,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(ReadBodyStream(downloadContent->BodyStream), blobContent);
auto pageRanges = *pageBlobClient.GetPageRanges();
EXPECT_FALSE(pageRanges.RequestId.empty());
EXPECT_TRUE(pageRanges.ClearRanges.empty());
ASSERT_FALSE(pageRanges.PageRanges.empty());
EXPECT_EQ(static_cast<uint64_t>(pageRanges.PageRanges[0].Offset), 3_KB);
@ -147,6 +149,7 @@ namespace Azure { namespace Storage { namespace Test {
Azure::Core::Http::Url sourceUri(m_pageBlobClient->WithSnapshot(snapshot).GetUrl());
sourceUri.AppendQueryParameters(GetSas());
auto copyInfo = pageBlobClient.StartCopyIncremental(sourceUri.GetAbsoluteUrl());
EXPECT_FALSE(copyInfo->RequestId.empty());
EXPECT_FALSE(copyInfo->ETag.empty());
EXPECT_TRUE(IsValidTime(copyInfo->LastModified));
EXPECT_FALSE(copyInfo->CopyId.empty());
@ -160,6 +163,7 @@ namespace Azure { namespace Storage { namespace Test {
std::string leaseId1 = CreateUniqueLeaseId();
int32_t leaseDuration = 20;
auto aLease = *m_pageBlobClient->AcquireLease(leaseId1, leaseDuration);
EXPECT_FALSE(aLease.RequestId.empty());
EXPECT_FALSE(aLease.ETag.empty());
EXPECT_TRUE(IsValidTime(aLease.LastModified));
EXPECT_EQ(aLease.LeaseId, leaseId1);
@ -174,6 +178,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(properties.LeaseDuration.GetValue().empty());
auto rLease = *m_pageBlobClient->RenewLease(leaseId1);
EXPECT_FALSE(rLease.RequestId.empty());
EXPECT_FALSE(rLease.ETag.empty());
EXPECT_TRUE(IsValidTime(rLease.LastModified));
EXPECT_EQ(rLease.LeaseId, leaseId1);
@ -181,11 +186,13 @@ namespace Azure { namespace Storage { namespace Test {
std::string leaseId2 = CreateUniqueLeaseId();
EXPECT_NE(leaseId1, leaseId2);
auto cLease = *m_pageBlobClient->ChangeLease(leaseId1, leaseId2);
EXPECT_FALSE(cLease.RequestId.empty());
EXPECT_FALSE(cLease.ETag.empty());
EXPECT_TRUE(IsValidTime(cLease.LastModified));
EXPECT_EQ(cLease.LeaseId, leaseId2);
auto blobInfo = *m_pageBlobClient->ReleaseLease(leaseId2);
EXPECT_FALSE(blobInfo.RequestId.empty());
EXPECT_FALSE(blobInfo.ETag.empty());
EXPECT_TRUE(IsValidTime(blobInfo.LastModified));
@ -264,6 +271,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_THROW(blobClientWithoutAuth.CreateIfNotExists(m_blobContent.size()), StorageException);
{
auto response = blobClient.CreateIfNotExists(m_blobContent.size());
EXPECT_FALSE(response->RequestId.empty());
EXPECT_TRUE(response->Created);
}

View File

@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Test {
serviceUri,
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto userDelegationKey = *serviceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn);
auto userDelegationKey = serviceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn)->Key;
auto verify_file_read = [&](const std::string& sas) {
EXPECT_NO_THROW(fileClient0.Create());