This is an automated email from the git hooks/post-receive script. New commit to branch feature/657_update_to_flyway_5 in repository topia. See https://gitlab.nuiton.org/nuiton/topia.git commit 3975b75d2a9f96e1143423016d3d7a722b505560 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Jan 8 15:26:03 2018 +0100 Passes use of deprecated configuration directive from warn to error --- .../nuiton/topia/flyway/TopiaFlywayServiceImpl.java | 18 +++++++++--------- .../TopiaServiceFlywayInitOnCreateSchemaTest.java | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java b/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java index a0c268b3..dab436eb 100644 --- a/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java +++ b/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java @@ -40,6 +40,7 @@ import org.flywaydb.core.internal.util.Location; import org.nuiton.topia.persistence.TopiaApplicationContext; import org.nuiton.topia.persistence.TopiaException; import org.nuiton.topia.persistence.TopiaMigrationServiceException; +import org.nuiton.topia.persistence.TopiaMisconfigurationException; import org.nuiton.topia.persistence.jdbc.JdbcConfiguration; import java.io.IOException; @@ -77,6 +78,13 @@ public class TopiaFlywayServiceImpl implements TopiaFlywayService { @Override public void initTopiaService(TopiaApplicationContext topiaApplicationContext, Map<String, String> serviceConfiguration) { + if (serviceConfiguration.containsKey(FLYWAY_INIT_VERSION)) { + if (log.isErrorEnabled()) { + log.error(FLYWAY_INIT_VERSION + " is deprecated, use " + FLYWAY_BASELINE_VERSION + " instead"); + } + throw new TopiaMisconfigurationException(FLYWAY_INIT_VERSION + " is deprecated, use " + FLYWAY_BASELINE_VERSION + " instead", topiaApplicationContext.getConfiguration()); + } + modelVersion = topiaApplicationContext.getModelVersion(); // set flywayBaselineVersion if provided @@ -85,14 +93,6 @@ public class TopiaFlywayServiceImpl implements TopiaFlywayService { if (StringUtils.isBlank(flywayBaselineVersion)) { throw new IllegalArgumentException("'" + FLYWAY_BASELINE_VERSION + "' must not be empty"); } - } else if (serviceConfiguration.containsKey(FLYWAY_INIT_VERSION)) { - if (log.isWarnEnabled()) { - log.warn(FLYWAY_INIT_VERSION + " is deprecated, use " + FLYWAY_BASELINE_VERSION + " instead"); - } - flywayBaselineVersion = serviceConfiguration.get(FLYWAY_INIT_VERSION); - if (StringUtils.isBlank(flywayBaselineVersion)) { - throw new IllegalArgumentException("'" + FLYWAY_INIT_VERSION + "' must not be empty"); - } } // set useModelVersion if provided @@ -207,7 +207,7 @@ public class TopiaFlywayServiceImpl implements TopiaFlywayService { // Use model version, flywayInitVersion should not be specified Preconditions.checkState(Strings.isNullOrEmpty(flywayBaselineVersion), - FLYWAY_INIT_VERSION + " is not not compatible with " + USE_MODEL_VERSION + "=true"); + FLYWAY_BASELINE_VERSION + " is not not compatible with " + USE_MODEL_VERSION + "=true"); if (log.isInfoEnabled()) { log.info("Using model version: " + modelVersion); diff --git a/topia-service-flyway/src/test/java/org/nuiton/topia/flyway/TopiaServiceFlywayInitOnCreateSchemaTest.java b/topia-service-flyway/src/test/java/org/nuiton/topia/flyway/TopiaServiceFlywayInitOnCreateSchemaTest.java index 1115aa83..5fd7c44b 100644 --- a/topia-service-flyway/src/test/java/org/nuiton/topia/flyway/TopiaServiceFlywayInitOnCreateSchemaTest.java +++ b/topia-service-flyway/src/test/java/org/nuiton/topia/flyway/TopiaServiceFlywayInitOnCreateSchemaTest.java @@ -107,7 +107,7 @@ public class TopiaServiceFlywayInitOnCreateSchemaTest { TopiaFlywayServiceImpl.class.getName(), ImmutableMap.of( TopiaFlywayService.USE_MODEL_VERSION, "false", - TopiaFlywayService.FLYWAY_INIT_VERSION, "1.2.42" + TopiaFlywayService.FLYWAY_BASELINE_VERSION, "1.2.42" )); JdbcH2Helper jdbcH2Helper = new JdbcH2Helper(config); @@ -138,7 +138,7 @@ public class TopiaServiceFlywayInitOnCreateSchemaTest { TopiaFlywayServiceImpl.class.getName(), ImmutableMap.of( TopiaFlywayService.USE_MODEL_VERSION, "true", - TopiaFlywayService.FLYWAY_INIT_VERSION, "1.2.42" + TopiaFlywayService.FLYWAY_BASELINE_VERSION, "1.2.42" )); // new application context will init database schema because of topia.persistence.initSchema=true -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.