From 49b6a5155a085ab9b76436021cf735c6e8df93c5 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Thu, 28 Sep 2023 12:01:50 +0530 Subject: [PATCH] fix: tests --- src/test/java/io/supertokens/test/FeatureFlagTest.java | 1 + src/test/java/io/supertokens/test/mfa/MfaStorageTest.java | 4 ++-- .../io/supertokens/test/mfa/api/MfaUserIdMappingTest.java | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/io/supertokens/test/FeatureFlagTest.java b/src/test/java/io/supertokens/test/FeatureFlagTest.java index 8b5047c3c..1193c474f 100644 --- a/src/test/java/io/supertokens/test/FeatureFlagTest.java +++ b/src/test/java/io/supertokens/test/FeatureFlagTest.java @@ -26,6 +26,7 @@ import io.supertokens.cronjobs.Cronjobs; import io.supertokens.cronjobs.syncCoreConfigWithDb.SyncCoreConfigWithDb; import io.supertokens.emailpassword.EmailPassword; +import io.supertokens.featureflag.EE_FEATURES; import io.supertokens.featureflag.FeatureFlag; import io.supertokens.featureflag.FeatureFlagTestContent; import io.supertokens.featureflag.exceptions.FeatureNotEnabledException; diff --git a/src/test/java/io/supertokens/test/mfa/MfaStorageTest.java b/src/test/java/io/supertokens/test/mfa/MfaStorageTest.java index 1cb993d46..1393ce57b 100644 --- a/src/test/java/io/supertokens/test/mfa/MfaStorageTest.java +++ b/src/test/java/io/supertokens/test/mfa/MfaStorageTest.java @@ -162,7 +162,7 @@ public void deleteUserFromTenantTest() throws Exception { result.process.main, "user@example.com", "password" - ).id; + ).getSupertokensUserId(); // Iterate over all both tenants and enable the same set of factors for the same user ID for (TenantIdentifierWithStorage tid : new TenantIdentifierWithStorage[]{publicTenant, privateTenant}) { @@ -177,7 +177,7 @@ public void deleteUserFromTenantTest() throws Exception { assert mfaStorage.listFactors(privateTenant, userId).length == 0; assert mfaStorage.listFactors(publicTenant, userId).length == 2; - String userEmail = EmailPassword.signIn(privateTenant, result.process.main, "user@example.com", "password").email; + String userEmail = EmailPassword.signIn(privateTenant, result.process.main, "user@example.com", "password").loginMethods[0].email; assert userEmail.equals("user@example.com"); // Use should still exist in the private tenant since we have only disabled MFA related info // Deleting from non existent user should return false: diff --git a/src/test/java/io/supertokens/test/mfa/api/MfaUserIdMappingTest.java b/src/test/java/io/supertokens/test/mfa/api/MfaUserIdMappingTest.java index 4b90935a4..467a56215 100644 --- a/src/test/java/io/supertokens/test/mfa/api/MfaUserIdMappingTest.java +++ b/src/test/java/io/supertokens/test/mfa/api/MfaUserIdMappingTest.java @@ -19,7 +19,8 @@ import com.google.gson.JsonObject; import io.supertokens.Main; import io.supertokens.emailpassword.EmailPassword; -import io.supertokens.pluginInterface.emailpassword.UserInfo; + +import io.supertokens.pluginInterface.authRecipe.AuthRecipeUserInfo; import io.supertokens.test.mfa.MfaTestBase; import io.supertokens.useridmapping.UserIdMapping; import org.junit.Test; @@ -33,8 +34,8 @@ public void testExternalUserIdTranslation() throws Exception { Main main = result.process.getProcess(); JsonObject body = new JsonObject(); - UserInfo user = EmailPassword.signUp(main, "test@example.com", "testPass123"); - String superTokensUserId = user.id; + AuthRecipeUserInfo user = EmailPassword.signUp(main, "test@example.com", "testPass123"); + String superTokensUserId = user.getSupertokensUserId(); String externalUserId = "external-user-id"; // Create user id mapping first: