#1343 - Update for ... #1283 ENH: Support simplified test configuration (with docker setup typically via application-test.yml)

DefaultContainer with config.loadFromProperties(PropertiesLoader.load()); effectively runs eval twice on properties which is unnecessary.

Additionally add ServerConfig.setRunMigration() because I think it makes more sense / easier to find.

Remote PropertiesLoader.setProperty() as it is no longer required for the ebean-test-config plugin.
This commit is contained in:
Rob Bygrave
2018-03-09 10:34:25 +13:00
parent d0b24dc340
commit 6c8cf0c5b7
3 changed files with 11 additions and 12 deletions
@@ -1956,6 +1956,16 @@ public class ServerConfig {
this.durationWithNanos = durationWithNanos;
}
/**
* Set to true to run DB migrations on server start.
* <p>
* This is the same as serverConfig.getMigrationConfig().setRunMigration(). We have added this method here
* as it is often the only thing we need to configure for migrations.
*/
public void setRunMigration(boolean runMigration){
migrationConfig.setRunMigration(runMigration);
}
/**
* Set to true to generate the "create all" DDL on startup.
* <p>
@@ -56,17 +56,6 @@ public class PropertiesLoader {
return properties;
}
/**
* Set (override) a configuration property.
*
* This is expected to be only called by test configuration logic
* (ala automatic test configuration via ebean-test-config).
*/
public static synchronized void setProperty(String key, String value) {
load();
properties.setProperty(key, value);
}
/**
* Return a copy of the properties with 'eval' run on all the values.
* This resolves expressions like ${HOME} etc.
@@ -83,7 +83,7 @@ public class DefaultContainer implements SpiContainer {
ServerConfig config = new ServerConfig();
config.setName(name);
config.loadFromProperties(PropertiesLoader.load());
config.loadFromProperties();
return createServer(config);
}