Increasing test coverage
[aai/sparky-be.git] / src / test / java / org / onap / aai / sparky / sync / config / ElasticSearchSchemaConfigTest.java
1 package org.onap.aai.sparky.sync.config;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
6
7 import org.junit.Before;
8 import org.junit.Test;
9
10 public class ElasticSearchSchemaConfigTest {
11         
12 private ElasticSearchSchemaConfig elasticSchemaConfig;
13         
14         @Before
15           public void init() throws Exception {
16                 elasticSchemaConfig = new ElasticSearchSchemaConfig();
17               
18           }
19         
20         
21         @Test 
22         public void updateValues() {
23                 
24                 elasticSchemaConfig.setIndexName("entitysearchindex-localhost");
25                 assertNotNull(elasticSchemaConfig.getIndexName());
26                 elasticSchemaConfig.setIndexDocType("default");
27                 assertNotNull(elasticSchemaConfig.getIndexDocType());
28                 elasticSchemaConfig.setIndexSettingsFileName("/etc/es_settings.json");
29                 assertNotNull(elasticSchemaConfig.getIndexSettingsFileName());
30                 elasticSchemaConfig.setIndexMappingsFileName("/etc/es_mappings.json");
31                 assertNotNull(elasticSchemaConfig.getIndexMappingsFileName());
32                 assertNotNull(elasticSchemaConfig.toString());
33                 elasticSchemaConfig.setIndexName(null);
34                 assertNull(elasticSchemaConfig.getIndexName());
35                 elasticSchemaConfig.setIndexDocType(null);
36                 assertNull(elasticSchemaConfig.getIndexDocType());
37                 elasticSchemaConfig.setIndexSettingsFileName(null);
38                 assertNull(elasticSchemaConfig.getIndexSettingsFileName());
39                 elasticSchemaConfig.setIndexMappingsFileName(null);
40                 assertNull(elasticSchemaConfig.getIndexMappingsFileName());
41                 assertNotNull(elasticSchemaConfig.toString());
42
43                 
44         }
45         
46
47 }