Skip to content

Commit

Permalink
reformats code
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Jul 8, 2024
1 parent f9110cd commit 9606b55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

import io.supertokens.pluginInterface.exceptions.StorageQueryException;
import io.supertokens.pluginInterface.exceptions.StorageTransactionLogicException;
import io.supertokens.pluginInterface.multitenancy.*;
import io.supertokens.pluginInterface.multitenancy.TenantConfig;
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
import io.supertokens.pluginInterface.multitenancy.ThirdPartyConfig;
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
import io.supertokens.storage.postgresql.Start;
import io.supertokens.storage.postgresql.config.Config;
Expand All @@ -32,8 +34,8 @@
import java.sql.SQLException;
import java.util.HashMap;

import static io.supertokens.storage.postgresql.QueryExecutorTemplate.update;
import static io.supertokens.storage.postgresql.QueryExecutorTemplate.execute;
import static io.supertokens.storage.postgresql.QueryExecutorTemplate.update;
import static io.supertokens.storage.postgresql.config.Config.getConfig;

public class MultitenancyQueries {
Expand All @@ -52,7 +54,8 @@ static String getQueryToCreateTenantConfigsTable(Start start) {
+ "passwordless_enabled BOOLEAN,"
+ "third_party_enabled BOOLEAN,"
+ "is_first_factors_null BOOLEAN,"
+ "CONSTRAINT " + Utils.getConstraintName(schema, tenantConfigsTable, null, "pkey") + " PRIMARY KEY (connection_uri_domain, app_id, tenant_id)"
+ "CONSTRAINT " + Utils.getConstraintName(schema, tenantConfigsTable, null, "pkey") +
" PRIMARY KEY (connection_uri_domain, app_id, tenant_id)"
+ ");";
// @formatter:on
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ public void storageInstanceIsReusedAcrossTenants()
StorageLayer.getStorage(new TenantIdentifier(null, null, null), process.getProcess()));

Assert.assertEquals(
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess()).getAccessTokenValidityInMillis(),
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess())
.getAccessTokenValidityInMillis(),
(long) 3600 * 1000);

Assert.assertEquals(Config.getConfig(new TenantIdentifier(null, "abc", null), process.getProcess())
Expand Down Expand Up @@ -238,7 +239,8 @@ public void storageInstanceIsReusedAcrossTenantsComplex()
StorageLayer.getStorage(new TenantIdentifier(null, null, null), process.getProcess()));

Assert.assertEquals(
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess()).getAccessTokenValidityInMillis(),
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess())
.getAccessTokenValidityInMillis(),
(long) 3600 * 1000);

Assert.assertEquals(Config.getConfig(new TenantIdentifier(null, "abc", null), process.getProcess())
Expand Down Expand Up @@ -454,7 +456,8 @@ public void newStorageIsNotCreatedWhenSameTenantIsAdded()
existingStorage);

Assert.assertEquals(
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess()).getAccessTokenValidityInMillis(),
Config.getConfig(new TenantIdentifier(null, null, null), process.getProcess())
.getAccessTokenValidityInMillis(),
(long) 3600 * 1000);

Assert.assertEquals(Config.getConfig(new TenantIdentifier(null, "abc", null), process.getProcess())
Expand Down

0 comments on commit 9606b55

Please sign in to comment.