Skip to content

Commit

Permalink
fix: fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamassoltesz committed Dec 21, 2024
1 parent cd1acd5 commit 2371c6d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

import java.io.IOException;

import static org.junit.Assert.*;
import static io.supertokens.storage.postgresql.QueryExecutorTemplate.update;
import static org.junit.Assert.*;

public class TestForNoCrashDuringStartup {
TestingProcessManager.TestingProcess process;
Expand Down Expand Up @@ -112,7 +112,7 @@ public void testThatCUDRecoversWhenItFailsToAddEntryDuringCreation() throws Exce
fail();
} catch (HttpResponseException e) {
// ignore
assertEquals("Http error. Status Code: 500. Message: java.sql.SQLException: Simulated error in addTenantIdInTargetStorage", e.getMessage());
assertEquals("Http error. Status Code: 500. Message: io.supertokens.pluginInterface.exceptions.StorageQueryException: java.sql.SQLException: Simulated error in addTenantIdInTargetStorage", e.getMessage());
}

MultitenancyQueries.simulateErrorInAddingTenantIdInTargetStorage_forTesting = false;
Expand Down Expand Up @@ -165,7 +165,7 @@ public void testThatCUDRecoversWhenTheDbIsDownDuringCreationButDbComesUpLater()
fail();
} catch (HttpResponseException e) {
// ignore
assertEquals("Http error. Status Code: 500. Message: java.sql.SQLException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: database \"st5000\" does not exist", e.getMessage());
assertEquals("Http error. Status Code: 500. Message: io.supertokens.pluginInterface.exceptions.StorageQueryException: java.sql.SQLException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: database \"st5000\" does not exist", e.getMessage());
}

update(start, "CREATE DATABASE st5000;", pst -> {
Expand Down Expand Up @@ -546,7 +546,7 @@ public void testThatTenantComesToLifeOnceTheTargetDbIsUpAfterCoreRestart() throw
fail();
} catch (HttpResponseException e) {
// ignore
assertEquals("Http error. Status Code: 500. Message: java.sql.SQLException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: database \"st5000\" does not exist", e.getMessage());
assertEquals("Http error. Status Code: 500. Message: io.supertokens.pluginInterface.exceptions.StorageQueryException: java.sql.SQLException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: FATAL: database \"st5000\" does not exist", e.getMessage());
}

process.kill(false);
Expand Down

0 comments on commit 2371c6d

Please sign in to comment.