Skip to content

Commit

Permalink
Add additional assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Oct 6, 2023
1 parent f2cfa77 commit a22de25
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ClockSkewInterceptorTest {
fun testNotSkewed() {
val clientTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400")
val serverTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400")
assertEquals(clientTime, serverTime)
assertFalse(clientTime.isSkewed(serverTime))
}

Expand Down Expand Up @@ -56,7 +57,7 @@ class ClockSkewInterceptorTest {
assertTrue(clientTime.isSkewed(serverTime))
assertEquals(CLOCK_SKEW_THRESHOLD, clientTime.getSkew(serverTime))

// narrow the skew by one second, crossing the threshold
// shrink the skew by one second, crossing the threshold
clientTime += 1.seconds
assertFalse(clientTime.isSkewed(serverTime))
}
Expand Down Expand Up @@ -95,6 +96,7 @@ class ClockSkewInterceptorTest {
fun testClockSkewNotApplied() = runTest {
val serverTimeString = "Wed, 06 Oct 2023 13:16:04 -0000"
val clientTimeString = "20231006T131604Z"
assertEquals(Instant.fromRfc5322(serverTimeString), Instant.fromIso8601(clientTimeString))

val client = getMockClient(
"bla".encodeToByteArray(),
Expand Down

0 comments on commit a22de25

Please sign in to comment.