aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-common-configuration-management/openecomp-configuration-management-test/src/test/java/org/openecomp/config/test/GlobalAndNSConfigTest.java
blob: 87324aa35c5100ef572e5760ba480f498a41990d (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
package org.openecomp.config.test;

import org.openecomp.config.api.Configuration;
import org.openecomp.config.api.ConfigurationManager;
import org.openecomp.config.util.ConfigTestConstant;
import org.openecomp.config.util.TestUtil;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by sheetalm on 10/13/2016.
 * Scenario 10 Verify configuration present in both global and defined namespace
 */
public class GlobalAndNSConfigTest {

    public final static String NAMESPACE = "GlobalAndNSConfig";

    @Before
    public void setUp() throws IOException {
        String data = "{name:\"SCM\"}";
        TestUtil.writeFile(data);
    }

    @Test
    public void testNamespaceInConfig() throws IOException, InterruptedException {
        Configuration config = ConfigurationManager.lookup();
        Assert.assertEquals("a-zA-Z",config.getAsString(NAMESPACE, ConfigTestConstant.ARTIFACT_NAME_UPPER ));
        Assert.assertEquals("a-zA-Z_0-9",config.getAsString(ConfigTestConstant.ARTIFACT_NAME_UPPER ));
    }

    @After
    public void tearDown() throws Exception {
        TestUtil.cleanUp();
    }




}