Skip to content

Commit

Permalink
test: fix flaky test based on current time
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati committed Aug 31, 2024
1 parent 0529135 commit 21ddf5e
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,26 @@ public void shouldDelegateAadCookie() throws Exception {
ArgumentCaptor<io.vertx.core.http.Cookie> cookieCaptor =
ArgumentCaptor.forClass(io.vertx.core.http.Cookie.class);
verify(routingContext).addCookie(cookieCaptor.capture());
String expectedCookie = io.vertx.core.http.Cookie.cookie(cookie.getName(), cookie.getValue())
io.vertx.core.http.Cookie expectedCookie = io.vertx.core.http.Cookie.cookie(cookie.getName(), cookie.getValue())
.setMaxAge(cookie.getMaxAge())
.setSecure(cookie.getSecure())
.setHttpOnly(cookie.isHttpOnly())
.setPath(cookie.getPath())
.setDomain(cookie.getDomain())
.encode();
assertThat(cookieCaptor.getValue().encode()).isEqualTo(expectedCookie);
.setDomain(cookie.getDomain());
io.vertx.core.http.Cookie capturedCookie = cookieCaptor.getValue();
assertThat(capturedCookie).extracting(
io.vertx.core.http.Cookie::getName,
io.vertx.core.http.Cookie::getMaxAge,
io.vertx.core.http.Cookie::getPath,
io.vertx.core.http.Cookie::getDomain,
io.vertx.core.http.Cookie::isSecure,
io.vertx.core.http.Cookie::isHttpOnly
).containsExactly(
expectedCookie.getName(), expectedCookie.getMaxAge(),
expectedCookie.getPath(), expectedCookie.getDomain(),
expectedCookie.isSecure(), expectedCookie.isHttpOnly()
):

}

@Test
Expand Down

0 comments on commit 21ddf5e

Please sign in to comment.