Pārlūkot izejas kodu

Fix flaky test

Issue gh-15735
Steve Riesenberg 10 mēneši atpakaļ
vecāks
revīzija
af2b84246b

+ 2 - 2
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));