re base code
[sdc.git] / common / onap-common-configuration-management / onap-configuration-management-test / src / test / java / org / onap / config / test / GlobalAndNSConfigTest.java
1 package org.onap.config.test;
2
3 import org.junit.After;
4 import org.junit.Assert;
5 import org.junit.Before;
6 import org.junit.Test;
7 import org.onap.config.api.Configuration;
8 import org.onap.config.api.ConfigurationManager;
9 import org.onap.config.util.ConfigTestConstant;
10 import org.onap.config.util.TestUtil;
11
12 import java.io.IOException;
13
14 /**
15  * Created by sheetalm on 10/13/2016.
16  * Scenario 10 Verify configuration present in both global and defined namespace
17  */
18 public class GlobalAndNSConfigTest {
19
20     public final static String NAMESPACE = "GlobalAndNSConfig";
21
22     @Before
23     public void setUp() throws IOException {
24         String data = "{name:\"SCM\"}";
25         TestUtil.writeFile(data);
26     }
27
28     @Test
29     public void testNamespaceInConfig() throws IOException, InterruptedException {
30         Configuration config = ConfigurationManager.lookup();
31         Assert.assertEquals("a-zA-Z",config.getAsString(NAMESPACE, ConfigTestConstant.ARTIFACT_NAME_UPPER ));
32         Assert.assertEquals("a-zA-Z_0-9",config.getAsString(ConfigTestConstant.ARTIFACT_NAME_UPPER ));
33     }
34
35     @After
36     public void tearDown() throws Exception {
37         TestUtil.cleanUp();
38     }
39
40
41
42
43 }