From af2b84246b08e4322eb64a76a5a5618de127e412 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg <5248162+sjohnr@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:56:53 -0500 Subject: [PATCH] Fix flaky test Issue gh-15735 --- .../authentication/ott/JdbcOneTimeTokenServiceTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenServiceTests.java b/core/src/test/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenServiceTests.java index 2bbca29282..2908113413 100644 --- a/core/src/test/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenServiceTests.java +++ b/core/src/test/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenServiceTests.java @@ -161,8 +161,8 @@ class JdbcOneTimeTokenServiceTests { @Test void cleanupExpiredTokens() { Clock clock = mock(Clock.class); - Instant fiveMinutesAgo = Instant.now().minus(Duration.ofMinutes(5)); - given(clock.instant()).willReturn(fiveMinutesAgo); + Instant tenMinutesAgo = Instant.now().minus(Duration.ofMinutes(10)); + given(clock.instant()).willReturn(tenMinutesAgo); this.oneTimeTokenService.setClock(clock); OneTimeToken token1 = this.oneTimeTokenService.generate(new GenerateOneTimeTokenRequest(USERNAME)); OneTimeToken token2 = this.oneTimeTokenService.generate(new GenerateOneTimeTokenRequest(USERNAME));