mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 21:42:17 +00:00
Fix flaky test
Issue gh-15735
This commit is contained in:
parent
da2561f9ad
commit
af2b84246b
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user