Skip to content

Commit 35c68a6

Browse files
authored
fix: mongo fixes (#821)
1 parent 6885e13 commit 35c68a6

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

src/main/java/io/supertokens/ProcessState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public EventAndException(PROCESS_STATE state, Exception e) {
113113

114114
public EventAndException(PROCESS_STATE state, Exception e, JsonObject data) {
115115
this.state = state;
116+
this.exception = e;
116117
this.data = data;
117118
}
118119
}

src/test/java/io/supertokens/test/accountlinking/TimeJoinedTest.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.supertokens.featureflag.EE_FEATURES;
2424
import io.supertokens.featureflag.FeatureFlagTestContent;
2525
import io.supertokens.multitenancy.Multitenancy;
26+
import io.supertokens.pluginInterface.STORAGE_TYPE;
2627
import io.supertokens.pluginInterface.authRecipe.AuthRecipeUserInfo;
2728
import io.supertokens.pluginInterface.dashboard.DashboardSearchTags;
2829
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
@@ -66,6 +67,10 @@ public void testThatTimeJoinedIsCorrectWhileLinkingAndUnlinking() throws Excepti
6667
process.startProcess();
6768
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
6869

70+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
71+
return;
72+
}
73+
6974
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
7075
Thread.sleep(100);
7176
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
@@ -99,6 +104,10 @@ public void testThatTimeJoinedIsCorrectWhileAssociatingTenants() throws Exceptio
99104
process.startProcess();
100105
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
101106

107+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
108+
return;
109+
}
110+
102111
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
103112
Thread.sleep(100);
104113
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
@@ -149,6 +158,10 @@ public void testUserPaginationIsFineWithUnlinkAndUnlinkAccounts() throws Excepti
149158
process.startProcess();
150159
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
151160

161+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
162+
return;
163+
}
164+
152165
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
153166
Thread.sleep(100);
154167
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
@@ -194,6 +207,10 @@ public void testUserPaginationIsFineWithTenantAssociation() throws Exception {
194207
process.startProcess();
195208
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
196209

210+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
211+
return;
212+
}
213+
197214
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
198215
Thread.sleep(100);
199216
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
@@ -239,6 +256,10 @@ public void testUserSearchWorksWithUnlinkAndLinkAccounts() throws Exception {
239256
process.startProcess();
240257
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
241258

259+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
260+
return;
261+
}
262+
242263
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
243264
Thread.sleep(100);
244265
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
@@ -290,6 +311,10 @@ public void testUserSearchWorksWithTenantAssociation() throws Exception {
290311
process.startProcess();
291312
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
292313

314+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
315+
return;
316+
}
317+
293318
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
294319
Thread.sleep(100);
295320
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");

src/test/java/io/supertokens/test/accountlinking/UserIdMappingTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
import io.supertokens.emailpassword.EmailPassword;
2222
import io.supertokens.featureflag.EE_FEATURES;
2323
import io.supertokens.featureflag.FeatureFlagTestContent;
24+
import io.supertokens.pluginInterface.STORAGE_TYPE;
2425
import io.supertokens.pluginInterface.authRecipe.AuthRecipeUserInfo;
26+
import io.supertokens.storageLayer.StorageLayer;
2527
import io.supertokens.test.TestingProcessManager;
2628
import io.supertokens.test.Utils;
2729
import io.supertokens.useridmapping.UserIdMapping;
@@ -59,6 +61,10 @@ public void testUserIdMappingWithUnlinkedAccountUserid() throws Exception {
5961
process.startProcess();
6062
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
6163

64+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
65+
return;
66+
}
67+
6268
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
6369
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
6470

@@ -89,6 +95,10 @@ public void testUserIdMappingWithDeletedUser() throws Exception {
8995
process.startProcess();
9096
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
9197

98+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
99+
return;
100+
}
101+
92102
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
93103
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
94104

src/test/java/io/supertokens/test/accountlinking/UserSearchTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
import io.supertokens.featureflag.EE_FEATURES;
2424
import io.supertokens.featureflag.FeatureFlagTestContent;
2525
import io.supertokens.passwordless.Passwordless;
26+
import io.supertokens.pluginInterface.STORAGE_TYPE;
2627
import io.supertokens.pluginInterface.authRecipe.AuthRecipeUserInfo;
2728
import io.supertokens.pluginInterface.dashboard.DashboardSearchTags;
29+
import io.supertokens.storageLayer.StorageLayer;
2830
import io.supertokens.test.TestingProcessManager;
2931
import io.supertokens.test.Utils;
3032
import io.supertokens.thirdparty.ThirdParty;
@@ -63,6 +65,10 @@ public void testUserSearch() throws Exception {
6365
process.startProcess();
6466
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED));
6567

68+
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) {
69+
return;
70+
}
71+
6672
AuthRecipeUserInfo user1 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");
6773
Thread.sleep(100);
6874
AuthRecipeUserInfo user2 = EmailPassword.signUp(process.getProcess(), "[email protected]", "password");

0 commit comments

Comments
 (0)