File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
dsql/common/test/aws/sdk/kotlin/services/dsql Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import aws.smithy.kotlin.runtime.time.ManualClock
1313import kotlinx.coroutines.test.runTest
1414import kotlin.test.Test
1515import kotlin.test.assertContains
16+ import kotlin.test.assertEquals
1617import kotlin.test.assertFalse
1718import kotlin.time.Duration.Companion.seconds
1819
@@ -40,6 +41,10 @@ class DsqlAuthTokenGeneratorTest {
4041 listOf (" http://" , " https://" ).forEach {
4142 assertFalse(token.contains(it))
4243 }
44+
45+ val urlToken = Url .parse(" https://$token " )
46+ val xAmzDate = urlToken.parameters.decodedParameters.getValue(" X-Amz-Date" ).single()
47+ assertEquals(clock.now(), Instant .fromIso8601(xAmzDate))
4348 }
4449
4550 @Test
@@ -65,5 +70,9 @@ class DsqlAuthTokenGeneratorTest {
6570 listOf (" http://" , " https://" ).forEach {
6671 assertFalse(token.contains(it))
6772 }
73+
74+ val urlToken = Url .parse(" https://$token " )
75+ val xAmzDate = urlToken.parameters.decodedParameters.getValue(" X-Amz-Date" ).single()
76+ assertEquals(clock.now(), Instant .fromIso8601(xAmzDate))
6877 }
6978}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import aws.smithy.kotlin.runtime.time.ManualClock
1313import kotlinx.coroutines.test.runTest
1414import kotlin.test.Test
1515import kotlin.test.assertContains
16+ import kotlin.test.assertEquals
1617import kotlin.test.assertFalse
1718import kotlin.time.Duration.Companion.seconds
1819
@@ -45,5 +46,9 @@ class RdsAuthTokenGeneratorTest {
4546 listOf (" http://" , " https://" ).forEach {
4647 assertFalse(token.contains(it))
4748 }
49+
50+ val urlToken = Url .parse(" https://$token " )
51+ val xAmzDate = urlToken.parameters.decodedParameters.getValue(" X-Amz-Date" ).single()
52+ assertEquals(clock.now(), Instant .fromIso8601(xAmzDate))
4853 }
4954}
You can’t perform that action at this time.
0 commit comments