From b94e5b1fba1343721b11369bc91eae55c47d3082 Mon Sep 17 00:00:00 2001 From: Viacheslav Klimov Date: Mon, 19 Oct 2026 13:51:21 +0300 Subject: [PATCH] Fix TwoFactorAuthTest compilation after merging lts-4.2 --- .../thingsboard/server/controller/TwoFactorAuthTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java index 59690dc008..fd88b2ca65 100644 --- a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java @@ -154,7 +154,7 @@ public class TwoFactorAuthTest extends AbstractControllerTest { @Test public void testWsAuthCmd_preVerificationTokenRejected() throws Exception { configureTotpTwoFa(); - logInWithPreVerificationToken(username, password); + logInWithMfaToken(username, password, Authority.PRE_VERIFICATION_TOKEN); wsClient = buildAndConnectWebSocketClient(); @@ -164,7 +164,7 @@ public class TwoFactorAuthTest extends AbstractControllerTest { @Test public void testWsQueryToken_preVerificationTokenRejected() throws Exception { configureTotpTwoFa(); - logInWithPreVerificationToken(username, password); + logInWithMfaToken(username, password, Authority.PRE_VERIFICATION_TOKEN); // The server accepts the handshake and closes the session right away from afterConnectionEstablished(). // connectBlocking() returns false when that close frame is processed before it checks the open state, @@ -179,7 +179,7 @@ public class TwoFactorAuthTest extends AbstractControllerTest { @Test public void testWs_accessTokenAcceptedAfterTwoFa() throws Exception { TotpTwoFaAccountConfig totpTwoFaAccountConfig = configureTotpTwoFa(); - logInWithPreVerificationToken(username, password); + logInWithMfaToken(username, password, Authority.PRE_VERIFICATION_TOKEN); JsonNode tokenPair = readResponse(doPost("/api/auth/2fa/verification/check?providerType=TOTP&verificationCode=" + getCorrectTotp(totpTwoFaAccountConfig)) .andExpect(status().isOk()), JsonNode.class); validateAndSetJwtToken(tokenPair, username);