Skip to content

Commit

Permalink
prevent flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Mar 28, 2024
1 parent f8e275f commit a695e84
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ class NettyServerCookieEncoderSpec extends Specification {

when:
long maxAge = 2592000
cookie = Cookie.of("id", "a3fWa").maxAge(maxAge)
String result = cookieEncoder.encode(cookie).get(0)
String expected = "id=a3fWa; Max-Age=2592000; " + Cookie.ATTRIBUTE_EXPIRES + "=" + expires(maxAge)
String expected2 = "id=a3fWa; Max-Age=2592000; " + Cookie.ATTRIBUTE_EXPIRES + "=" + expires(maxAge + 1) // To prevent flakiness
cookie = Cookie.of("id", "a3fWa").maxAge(maxAge);
String result = cookieEncoder.encode(cookie).get(0);
String expected3 = "id=a3fWa; Max-Age=2592000; " + Cookie.ATTRIBUTE_EXPIRES + "=" + expires(maxAge - 1) // To prevent flakiness

then:
expected == result || expected2 == result
expected == result || expected2 == result || expected3 == result
}

void "ServerCookieEncoder is NettyServerCookieEncoder"() {
Expand Down

0 comments on commit a695e84

Please sign in to comment.