mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user