Skip to content

Commit

Permalink
make test provider the first in chain for test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbera87 committed Sep 8, 2024
1 parent f6111ca commit 0f4113b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ 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} };
}
};

class TestAwsBearerTokenIdentityResolver : public smithy::DefaultAwsBearerTokenIdentityResolver
{
public:
TestAwsBearerTokenIdentityResolver(): smithy::DefaultAwsBearerTokenIdentityResolver(){
AddBearerTokenProvider(Aws::MakeShared<TestSSOBearerTokenProvider>(ALLOC_TAG));
m_providerChainLegacy.insert(m_providerChainLegacy.begin(), Aws::MakeShared<TestSSOBearerTokenProvider>(ALLOC_TAG));
}
};
//===============================================================
Expand Down Expand Up @@ -302,8 +302,5 @@ TEST_F(SmithyClientTest, bearer) {

std::cout<<"header="<<res2.GetResult()->GetHeaderValue("authorization")<<std::endl;

//EXPECT_TRUE(res2.GetResult()->GetSigningAccessKey().empty());

//EXPECT_FALSE(res2.GetResult()->GetUri().GetURIString(true).empty());

EXPECT_EQ(res2.GetResult()->GetHeaderValue("authorization"), "Bearer testBearerToken");
}

0 comments on commit 0f4113b

Please sign in to comment.