Fixed testі

This commit is contained in:
Vladyslav_Prykhodko 2022-06-01 10:43:58 +03:00
parent fd6ead6c48
commit 9fd78e595c

View File

@ -156,14 +156,14 @@ public abstract class TwoFactorAuthTest extends AbstractControllerTest {
@Test @Test
public void testTwoFaPreVerificationTokenLifetime() throws Exception { public void testTwoFaPreVerificationTokenLifetime() throws Exception {
configureTotpTwoFa(twoFaSettings -> { configureTotpTwoFa(twoFaSettings -> {
twoFaSettings.setTotalAllowedTimeForVerification(5); twoFaSettings.setTotalAllowedTimeForVerification(65);
}); });
logInWithPreVerificationToken(username, password); logInWithPreVerificationToken(username, password);
await("expiration of the pre-verification token") await("expiration of the pre-verification token")
.atLeast(Duration.ofSeconds(3).plusMillis(500)) .atLeast(Duration.ofSeconds(30).plusMillis(500))
.atMost(Duration.ofSeconds(6)) .atMost(Duration.ofSeconds(70))
.untilAsserted(() -> { .untilAsserted(() -> {
doPost("/api/auth/2fa/verification/send?providerType=TOTP") doPost("/api/auth/2fa/verification/send?providerType=TOTP")
.andExpect(status().isUnauthorized()); .andExpect(status().isUnauthorized());