Skip to content

Commit

Permalink
Fix up an inheritance problem in TestClassWithDatabase (confusion bet…
Browse files Browse the repository at this point in the history
…ween the au.democracydevelopers one and the us.freeandfair one).
  • Loading branch information
vteague committed Aug 30, 2024
1 parent ec70191 commit 33cb177
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.mockito.*;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.ext.ScriptUtils;
import org.testcontainers.jdbc.JdbcDatabaseDelegate;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import spark.HaltException;
Expand Down Expand Up @@ -377,10 +376,9 @@ public class ACVRUploadTests extends TestClassWithAuth {
*/
@BeforeClass
public static void beforeAll() {
postgres.start();
Persistence.setProperties(createHibernateProperties(postgres));

final var containerDelegate = new JdbcDatabaseDelegate(postgres, "");
final var containerDelegate = setupContainerStartPostgres(postgres);

ScriptUtils.runInitScript(containerDelegate, "SQL/co-counties.sql");
ScriptUtils.runInitScript(containerDelegate, "SQL/corla-three-candidates-ten-votes-inconsistent-types.sql");
ScriptUtils.runInitScript(containerDelegate, "SQL/adams-partway-through-audit.sql");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.mockito.MockitoAnnotations;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.ext.ScriptUtils;
import org.testcontainers.jdbc.JdbcDatabaseDelegate;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import spark.HaltException;
Expand Down Expand Up @@ -70,10 +69,9 @@ public class EstimateSampleSizesTests extends TestClassWithAuth {
*/
@BeforeClass
public static void beforeAll() {
postgres.start();
Persistence.setProperties(createHibernateProperties(postgres));

final var containerDelegate = new JdbcDatabaseDelegate(postgres, "");
final var containerDelegate = setupContainerStartPostgres(postgres);

ScriptUtils.runInitScript(containerDelegate, "SQL/co-counties.sql");
ScriptUtils.runInitScript(containerDelegate, "SQL/simple-assertions.sql");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import us.freeandfair.corla.auth.AuthenticationInterface;
import us.freeandfair.corla.endpoint.Endpoint;
import us.freeandfair.corla.model.*;
import us.freeandfair.corla.util.TestClassWithDatabase;

import java.util.ArrayList;
import java.util.List;
Expand Down

0 comments on commit 33cb177

Please sign in to comment.