-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
2 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 |
---|---|---|
|
@@ -925,10 +925,13 @@ public void testAccountLinkingStatsWithDifferentStorages() throws Exception { | |
AuthRecipeUserInfo user1 = EmailPassword.signUp(ts, process.getProcess(), "[email protected]", "password"); | ||
AuthRecipeUserInfo user2 = EmailPassword.signUp(ts, process.getProcess(), "[email protected]", "password"); | ||
AuthRecipeUserInfo user3 = EmailPassword.signUp(ts, process.getProcess(), "[email protected]", "password"); | ||
AuthRecipeUserInfo user4 = EmailPassword.signUp(ts, process.getProcess(), "[email protected]", "password"); | ||
AuthRecipeUserInfo user5 = EmailPassword.signUp(ts, process.getProcess(), "[email protected]", "password"); | ||
|
||
AuthRecipe.createPrimaryUser(process.getProcess(), ts.toAppIdentifierWithStorage(), user1.getSupertokensUserId()); | ||
AuthRecipe.linkAccounts(process.getProcess(), ts.toAppIdentifierWithStorage(), user2.getSupertokensUserId(), user1.getSupertokensUserId()); | ||
AuthRecipe.createPrimaryUser(process.getProcess(), ts.toAppIdentifierWithStorage(), user3.getSupertokensUserId()); | ||
AuthRecipe.linkAccounts(process.getProcess(), ts.toAppIdentifierWithStorage(), user4.getSupertokensUserId(), user3.getSupertokensUserId()); | ||
} | ||
|
||
{ // tenant 1 | ||
|
@@ -995,6 +998,28 @@ public void testAccountLinkingStatsWithDifferentStorages() throws Exception { | |
responseBody.addProperty("email", "[email protected]"); | ||
responseBody.addProperty("password", "password"); | ||
|
||
JsonObject signInResponse = HttpRequestForTesting.sendJsonPOSTRequest(process.getProcess(), "", | ||
"http://localhost:3567/t1/recipe/signin", responseBody, 1000, 1000, null, SemVer.v4_0.get(), | ||
"emailpassword"); | ||
|
||
assertEquals(signInResponse.get("status").getAsString(), "OK"); | ||
} | ||
{ | ||
JsonObject responseBody = new JsonObject(); | ||
responseBody.addProperty("email", "[email protected]"); | ||
responseBody.addProperty("password", "password"); | ||
|
||
JsonObject signInResponse = HttpRequestForTesting.sendJsonPOSTRequest(process.getProcess(), "", | ||
"http://localhost:3567/t1/recipe/signin", responseBody, 1000, 1000, null, SemVer.v4_0.get(), | ||
"emailpassword"); | ||
|
||
assertEquals(signInResponse.get("status").getAsString(), "OK"); | ||
} | ||
{ | ||
JsonObject responseBody = new JsonObject(); | ||
responseBody.addProperty("email", "[email protected]"); | ||
responseBody.addProperty("password", "password"); | ||
|
||
JsonObject signInResponse = HttpRequestForTesting.sendJsonPOSTRequest(process.getProcess(), "", | ||
"http://localhost:3567/t1/recipe/signin", responseBody, 1000, 1000, null, SemVer.v4_0.get(), | ||
"emailpassword"); | ||
|
@@ -1015,11 +1040,11 @@ public void testAccountLinkingStatsWithDifferentStorages() throws Exception { | |
|
||
assertEquals(3, alStats.entrySet().size()); | ||
assertTrue(alStats.get("usesAccountLinking").getAsBoolean()); | ||
assertEquals(2, alStats.get("totalUserCountWithMoreThanOneLoginMethod").getAsInt()); | ||
assertEquals(3, alStats.get("totalUserCountWithMoreThanOneLoginMethod").getAsInt()); | ||
|
||
JsonArray maus = alStats.get("mauWithMoreThanOneLoginMethod").getAsJsonArray(); | ||
assertEquals(30, maus.size()); | ||
assertEquals(2, maus.get(0).getAsInt()); | ||
assertEquals(3, maus.get(0).getAsInt()); | ||
} | ||
|
||
process.kill(); | ||
|