blob: d179edfcfb129cc0f48d0db3259ee7ad52a27fe6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package org.onap.config.test;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.onap.config.api.Configuration;
import org.onap.config.api.ConfigurationManager;
import org.onap.config.util.ConfigTestConstant;
import org.onap.config.util.TestUtil;
import java.io.IOException;
import static org.onap.config.util.TestUtil.writeFile;
/**
* Scenario
* Check loadorder for merge and overide. Higher loadorder takes precedence for override
* LoWer loadorder takes precedence for merge.
*/
public class LoadOrderMergeAndOverrideTest {
public static final String NAMESPACE = "LoadOrderConfiguration";
@Before
public void setUp() throws IOException {
String data = "{name:\"SCM\"}";
writeFile(data);
}
@Test
public void testConfigurationWithPropertiesFileFormat(){
Configuration config = ConfigurationManager.lookup();
Assert.assertEquals(config.getAsString(NAMESPACE, ConfigTestConstant.ARTIFACT_NAME_MAXLENGTH ), "14");
Assert.assertEquals("5", config.getAsString(NAMESPACE, "artifact.length"));
Assert.assertEquals("56", config.getAsString(NAMESPACE, "artifact.size"));
}
@After
public void tearDown() throws Exception {
TestUtil.cleanUp();
}
}
|