Skip to content

Commit afab8b6

Browse files
committed
changed std to aws
1 parent c562c40 commit afab8b6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/aws-cpp-sdk-core-tests/aws/auth/SSOCredentialTrackingTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,19 @@ class SSOCredentialsProviderTrackingTest : public Aws::Testing::AwsCppSdkGTestSu
135135
check.close();
136136
}
137137

138-
void CreateSSOSessionTokenFile(const Aws::String& sessionName /* e.g., "my-sso" */) {
138+
void CreateSSOSessionTokenFile(const Aws::String& sessionName) {
139139
const Aws::String hash = Aws::Utils::HashingUtils::HexEncode(
140140
Aws::Utils::HashingUtils::CalculateSHA1(sessionName));
141141
const Aws::String tokenPath = m_ssoCacheDir + PATH_DELIM + hash + ".json";
142142

143143
std::ofstream tokenFile(tokenPath.c_str());
144144
ASSERT_TRUE(tokenFile.good()) << "Failed to open " << tokenPath;
145145

146-
const auto futureTime = Aws::Utils::DateTime::Now() + std::chrono::hours(1);
146+
const auto futureTime = Aws::Utils::DateTime::Now().Millis() + 3600000;
147+
const auto futureDateTime = Aws::Utils::DateTime(futureTime);
147148
tokenFile << "{\n"
148149
" \"accessToken\": \"test-token\",\n"
149-
" \"expiresAt\": \"" << futureTime.ToGmtString(Aws::Utils::DateFormat::ISO_8601) << "\"\n"
150+
" \"expiresAt\": \"" << futureDateTime.ToGmtString(Aws::Utils::DateFormat::ISO_8601) << "\"\n"
150151
// (region/startUrl fields are optional on this path)
151152
"}\n";
152153
tokenFile.close();

0 commit comments

Comments
 (0)