mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#602 - Elastic - Add support for ebean.docstore.generateMapping
This commit is contained in:
@@ -10,7 +10,7 @@ import static org.junit.Assert.*;
|
||||
public class DocStoreConfigTest {
|
||||
|
||||
@Test
|
||||
public void testLoadSettings() throws Exception {
|
||||
public void loadSettings() throws Exception {
|
||||
|
||||
DocStoreConfig config = new DocStoreConfig();
|
||||
|
||||
@@ -25,9 +25,44 @@ public class DocStoreConfigTest {
|
||||
config.loadSettings(wrapper);
|
||||
|
||||
assertTrue(config.isActive());
|
||||
assertFalse(config.isGenerateMapping());
|
||||
assertFalse(config.isDropCreate());
|
||||
assertEquals("http://foo:9800", config.getUrl());
|
||||
assertEquals(DocStoreMode.IGNORE, config.getPersist());
|
||||
assertEquals(99, config.getBulkBatchSize());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loadSettings_generateMapping_dropCreate() throws Exception {
|
||||
|
||||
DocStoreConfig config = new DocStoreConfig();
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("ebean.docstore.generateMapping", "true");
|
||||
properties.setProperty("ebean.docstore.dropCreate", "true");
|
||||
|
||||
PropertiesWrapper wrapper = new PropertiesWrapper("ebean", null, properties);
|
||||
config.loadSettings(wrapper);
|
||||
|
||||
assertTrue(config.isGenerateMapping());
|
||||
assertTrue(config.isDropCreate());
|
||||
assertFalse(config.isCreate());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loadSettings_generateMapping_create() throws Exception {
|
||||
|
||||
DocStoreConfig config = new DocStoreConfig();
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("ebean.docstore.generateMapping", "true");
|
||||
properties.setProperty("ebean.docstore.create", "true");
|
||||
|
||||
PropertiesWrapper wrapper = new PropertiesWrapper("ebean", null, properties);
|
||||
config.loadSettings(wrapper);
|
||||
|
||||
assertTrue(config.isGenerateMapping());
|
||||
assertTrue(config.isCreate());
|
||||
assertFalse(config.isDropCreate());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user