Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions src/test/java/io/supertokens/test/PathRouterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2516,29 +2516,28 @@ public void tenantNotFoundWithAppIdTest()
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("localhost", "app1", "t1"), new EmailPasswordConfig(false),
new TenantConfig(new TenantIdentifier("localhost", "app1", null), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenantConfig),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("127.0.0.1", null, null), new EmailPasswordConfig(false),
new TenantConfig(new TenantIdentifier("localhost", "app1", "t1"), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenant2Config),
tenantConfig),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("127.0.0.1", "app1", "t1"), new EmailPasswordConfig(false),
new TenantConfig(new TenantIdentifier("127.0.0.1", null, null), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenant2Config),
false
);

Webserver.getInstance(process.getProcess()).addAPI(new WebserverAPI(process.getProcess(), "") {

@Override
Expand Down Expand Up @@ -2580,6 +2579,24 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I
"app1, public)");
}
}

Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("127.0.0.1", "app1", null), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenant2Config),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("127.0.0.1", "app1", "t1"), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenant2Config),
false
);

{
String response = HttpRequestForTesting.sendJsonPOSTRequest(process.getProcess(), "",
"http://localhost:3567/appid-app1/t1/test", new JsonObject(), 1000, 1000, null,
Expand Down Expand Up @@ -2637,6 +2654,14 @@ public void tenantNotFoundWithAppIdTest2()
tenantConfig),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("localhost", "app1", null), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
tenantConfig),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier("localhost", "app1", "t1"), new EmailPasswordConfig(false),
Expand All @@ -2645,6 +2670,14 @@ public void tenantNotFoundWithAppIdTest2()
tenantConfig),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier(null, "app2", null), new EmailPasswordConfig(false),
new ThirdPartyConfig(false, new ThirdPartyConfig.Provider[0]),
new PasswordlessConfig(false),
new JsonObject()),
false
);
Multitenancy.addNewOrUpdateAppOrTenant(
process.getProcess(),
new TenantConfig(new TenantIdentifier(null, "app2", "t2"), new EmailPasswordConfig(false),
Expand Down