blob: e4a511064edd49fd3e8d77943b1e03c2102d20b8 (
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
|
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;
/**
* 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();
}
}
|