Skip to content

Commit af2b842

Browse files
committed
Fix flaky test
Issue gh-15735
1 parent da2561f commit af2b842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/test/java/org/springframework/security/authentication/ott/JdbcOneTimeTokenServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ void consumeWhenTokenIsExpiredThenReturnNull() {
161161
@Test
162162
void cleanupExpiredTokens() {
163163
Clock clock = mock(Clock.class);
164-
Instant fiveMinutesAgo = Instant.now().minus(Duration.ofMinutes(5));
165-
given(clock.instant()).willReturn(fiveMinutesAgo);
164+
Instant tenMinutesAgo = Instant.now().minus(Duration.ofMinutes(10));
165+
given(clock.instant()).willReturn(tenMinutesAgo);
166166
this.oneTimeTokenService.setClock(clock);
167167
OneTimeToken token1 = this.oneTimeTokenService.generate(new GenerateOneTimeTokenRequest(USERNAME));
168168
OneTimeToken token2 = this.oneTimeTokenService.generate(new GenerateOneTimeTokenRequest(USERNAME));

0 commit comments

Comments
 (0)