diff --git a/src/main/java/com/avaje/ebean/config/ServerConfig.java b/src/main/java/com/avaje/ebean/config/ServerConfig.java index 44e5dab02..2f0230220 100644 --- a/src/main/java/com/avaje/ebean/config/ServerConfig.java +++ b/src/main/java/com/avaje/ebean/config/ServerConfig.java @@ -75,7 +75,7 @@ public class ServerConfig { /** * The EbeanServer name. */ - private String name; + private String name = "db"; /** * Typically configuration type objects that are passed by this ServerConfig @@ -105,7 +105,7 @@ public class ServerConfig { /** * Set to true if this is the default/primary server. */ - private boolean defaultServer; + private boolean defaultServer = true; /** * Set this to true to disable class path search. @@ -563,7 +563,7 @@ public class ServerConfig { } /** - * Set true if this EbeanServer should be registered as the "default" server + * Set false if you do not want this EbeanServer to be registered as the "default" server * with the Ebean singleton. *

* This is only used when {@link #setRegister(boolean)} is also true. diff --git a/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java b/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java index 2d9fd7523..e86f92be3 100644 --- a/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java +++ b/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java @@ -14,6 +14,7 @@ public class DbMigrationConfigTest { ServerConfig config = new ServerConfig(); config.setName("h2other"); config.loadFromProperties(); + config.setDefaultServer(false); DbMigrationConfig migrationConfig = config.getMigrationConfig(); diff --git a/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java b/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java index cb7dc971e..f3dac5fd1 100644 --- a/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java +++ b/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java @@ -46,6 +46,8 @@ public class TestPersistenceContextServerConfig extends BaseTestCase { config.loadFromProperties(properties); config.setPersistenceContextScope(PersistenceContextScope.QUERY); config.setContainerConfig(new ContainerConfig()); + config.setDefaultServer(false); + config.setRegister(false); // DataSourceConfig dataSourceConfig = new DataSourceConfig(); // dataSourceConfig.setUsername("sa");