ActivitySpec - Correcting logger messages
[sdc.git] / common / onap-common-configuration-management / onap-configuration-management-test / src / test / java / org / onap / config / test / FallbackToGlobalNSTest.java
1 package org.onap.config.test;
2
3 import org.onap.config.api.Configuration;
4 import org.onap.config.api.ConfigurationManager;
5 import org.onap.config.util.ConfigTestConstant;
6 import org.onap.config.util.TestUtil;
7 import org.junit.After;
8 import org.junit.Before;
9 import org.junit.Test;
10 import org.junit.Assert;
11
12 import java.io.IOException;
13
14 /**
15  * Scenario 12
16  * Verify configuration value fallback to the global namespace if the configuraton property doesnot exist in the namespace configuration
17  * Created by sheetalm on 10/14/2016.
18  */
19 public class FallbackToGlobalNSTest {
20
21     public final static String NAMESPACE = "FallbackToGlobalNS";
22
23     @Before
24     public void setUp() throws IOException {
25         String data = "{name:\"SCM\"}";
26         TestUtil.writeFile(data);
27     }
28
29     @Test
30     public void testFallbackToGlobalNS() throws IOException, InterruptedException {
31         Configuration config = ConfigurationManager.lookup();
32         Assert.assertEquals("14",config.getAsString(NAMESPACE, ConfigTestConstant.ARTIFACT_NAME_MAXLENGTH));
33         Assert.assertEquals("1024",config.getAsString(NAMESPACE, ConfigTestConstant.ARTIFACT_MAXSIZE));
34     }
35
36     @After
37     public void tearDown() throws Exception {
38         TestUtil.cleanUp();
39     }
40
41
42 }