From 82990f3e976765ca37dec0f0fb4c7817eef51807 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Tue, 26 Nov 2019 10:39:21 -0500 Subject: [PATCH] fix test --- .../java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java | 2 +- .../java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java index 498fb7859f9..3f46dbe608b 100644 --- a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java +++ b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/SchemaMigratorTest.java @@ -20,7 +20,7 @@ public class SchemaMigratorTest extends BaseTest { task.addSql(DriverTypeEnum.H2_EMBEDDED, "create table SOMETABLE (PID bigint not null, TEXTCOL varchar(255))"); getMigrator().addTask(task); - SchemaMigrator schemaMigrator = new SchemaMigrator("TEST_MIGRATION", getDataSource(), new Properties(), Collections.singletonList(task)); + SchemaMigrator schemaMigrator = new SchemaMigrator(BaseTest.TEST_MIGRATION_TABLE, getDataSource(), new Properties(), Collections.singletonList(task)); try { schemaMigrator.validate(); diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java index e425288ce8a..9d5398ea7f3 100644 --- a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java +++ b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java @@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.FlywayMigrator; import ca.uhn.fhir.jpa.migrate.JdbcUtils; -import ca.uhn.fhir.jpa.migrate.SchemaMigrator; import org.apache.commons.dbcp2.BasicDataSource; import org.intellij.lang.annotations.Language; import org.junit.After; @@ -17,6 +16,7 @@ import java.util.Set; public class BaseTest { + public static final String TEST_MIGRATION_TABLE = "TEST_MIGRATION"; private static final String DATABASE_NAME = "DATABASE"; private static int ourDatabaseUrl = 0; private String myUrl; @@ -42,7 +42,7 @@ public class BaseTest { myDataSource.setUsername("SA"); myDataSource.setPassword("SA"); myDataSource.setDriverClassName(DriverTypeEnum.H2_EMBEDDED.getDriverClassName()); - myMigrator = new FlywayMigrator("TEST_MIGRATION", myDataSource); + myMigrator = new FlywayMigrator(TEST_MIGRATION_TABLE, myDataSource); } protected BasicDataSource getDataSource() { @@ -52,8 +52,8 @@ public class BaseTest { @After public void resetMigrationVersion() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); - if (tableNames.contains(SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME)) { - executeSql("DELETE from " + SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME + " where \"installed_rank\" > 0"); + if (tableNames.contains(TEST_MIGRATION_TABLE)) { + executeSql("DELETE from " + TEST_MIGRATION_TABLE + " where \"installed_rank\" > 0"); } }