-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds missing check in userIdMapping tests (#486)
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ | |
import com.google.gson.JsonObject; | ||
import io.supertokens.ProcessState; | ||
import io.supertokens.emailpassword.EmailPassword; | ||
import io.supertokens.pluginInterface.STORAGE_TYPE; | ||
import io.supertokens.pluginInterface.emailpassword.UserInfo; | ||
import io.supertokens.storageLayer.StorageLayer; | ||
import io.supertokens.test.TestingProcessManager; | ||
import io.supertokens.test.Utils; | ||
import io.supertokens.test.httpRequest.HttpRequestForTesting; | ||
|
@@ -56,6 +58,10 @@ public void testBadInput() throws Exception { | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
{ | ||
// do not pass userId | ||
try { | ||
|
@@ -130,6 +136,10 @@ public void testRetrievingUserIdMappingWithUnknownUserId() throws Exception { | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
{ | ||
// retrieve userId mapping with unknown userId with SUPERTOKENS as the userIdType | ||
HashMap<String, String> QUERY_PARAM = new HashMap<>(); | ||
|
@@ -180,6 +190,10 @@ public void testRetrieveUserIdMapping() throws Exception { | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
// create a user and map their userId to an external userId | ||
UserInfo user = EmailPassword.signUp(process.main, "[email protected]", "testPass123"); | ||
String superTokensUserId = user.id; | ||
|
@@ -270,6 +284,10 @@ public void testRetrievingUserIdMappingWithoutSendingUserIdType() throws Excepti | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
// create a user and map their userId to an external userId | ||
UserInfo user = EmailPassword.signUp(process.main, "[email protected]", "testPass123"); | ||
String superTokensUserId = user.id; | ||
|
@@ -321,6 +339,10 @@ public void testRetrieveUserIdMappingWithExternalUserIdInfoAsNull() throws Excep | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
// create a user and map their userId to an external userId | ||
UserInfo user = EmailPassword.signUp(process.main, "[email protected]", "testPass123"); | ||
String superTokensUserId = user.id; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,6 +326,10 @@ public void testDeletingAUserIdMappingWithoutSendingUserIdType() throws Exceptio | |
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args); | ||
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STARTED)); | ||
|
||
if (StorageLayer.getStorage(process.getProcess()).getType() != STORAGE_TYPE.SQL) { | ||
return; | ||
} | ||
|
||
// create a userId mapping | ||
UserInfo userInfo = EmailPassword.signUp(process.main, "[email protected]", "testPass123"); | ||
UserIdMapping userIdMapping = new UserIdMapping(userInfo.id, "externalUserId", "externalUserIdInfo"); | ||
|