From 0f4113b97c5efce3305b868b34d9c6d608580346 Mon Sep 17 00:00:00 2001 From: Soumava Bera Date: Sun, 8 Sep 2024 20:12:33 +0000 Subject: [PATCH] make test provider the first in chain for test --- .../smithy/client/SmithyClientTest.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp b/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp index 8f7fa89adea..0d1501cea06 100644 --- a/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp +++ b/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp @@ -91,7 +91,7 @@ class TestSSOBearerTokenProvider : public Aws::Auth::AWSBearerTokenProviderBase public: Aws::Auth::AWSBearerToken GetAWSBearerToken() override { - return Aws::Auth::AWSBearerToken{"testToken", Aws::Utils::DateTime::Now() + std::chrono::milliseconds{100000} }; + return Aws::Auth::AWSBearerToken{"testBearerToken", Aws::Utils::DateTime::Now() + std::chrono::milliseconds{100000} }; } }; @@ -99,7 +99,7 @@ class TestAwsBearerTokenIdentityResolver : public smithy::DefaultAwsBearerTokenI { public: TestAwsBearerTokenIdentityResolver(): smithy::DefaultAwsBearerTokenIdentityResolver(){ - AddBearerTokenProvider(Aws::MakeShared(ALLOC_TAG)); + m_providerChainLegacy.insert(m_providerChainLegacy.begin(), Aws::MakeShared(ALLOC_TAG)); } }; //=============================================================== @@ -302,8 +302,5 @@ TEST_F(SmithyClientTest, bearer) { std::cout<<"header="<GetHeaderValue("authorization")<GetSigningAccessKey().empty()); - - //EXPECT_FALSE(res2.GetResult()->GetUri().GetURIString(true).empty()); - + EXPECT_EQ(res2.GetResult()->GetHeaderValue("authorization"), "Bearer testBearerToken"); } \ No newline at end of file