summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-05 13:38:34 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-05 13:38:34 +0100
commit912e5e9201bf60169ad39686ba5bd9d9bc6e3579 (patch)
tree2f11bc4045218ef5d9714e607523562d32d6ab16 /src/test/java/org/onap
parent886191eea29a6a87b891d869e8b3855c95967c49 (diff)
Rework configuration
Move the JSON content from the properties file to json files for all configuration defined in clds-reference.properties Issue-ID: CLAMP-136 Change-Id: Idfb21be729d7260518756e5f585371de78d18944 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
index 79b26111f..484a13e60 100644
--- a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
@@ -59,6 +59,7 @@ public class CldsReferencePropertiesItCase {
assertEquals(refProp.getStringValue("policy.ms.policyNamePrefix", ""), "Config_MS_");
assertEquals(refProp.getStringValue("policy.ms.policyNamePrefix", "testos"), "Config_MS_");
assertEquals(refProp.getStringValue("policy.ms", "policyNamePrefix"), "Config_MS_");
+ assertNull(refProp.getStringValue("does.not.exist"));
}
/**
@@ -68,7 +69,7 @@ public class CldsReferencePropertiesItCase {
* when JSON parsing fails
*/
@Test
- public void testJsonTemplate() throws IOException {
+ public void testGetJsonTemplate() throws IOException {
// ui.location.default={"DC1":"Data Center 1","DC2":"Data Center
// 2","DC3":"Data Center 3"}
ObjectNode root = (ObjectNode) refProp.getJsonTemplate("ui.location.default");
@@ -81,4 +82,19 @@ public class CldsReferencePropertiesItCase {
root = (ObjectNode) refProp.getJsonTemplate("ui.location", "");
assertNull(root);
}
+
+ /**
+ * Test getting prop value as a JSON Node / template.
+ *
+ * @throws IOException
+ * when JSON parsing fails
+ */
+ @Test
+ public void testGetFileContent() throws IOException {
+ String content = refProp.getFileContent("sdc.decode.service_ids");
+ assertEquals("{}", content);
+ // Test composite key
+ content = refProp.getFileContent("sdc.decode", "service_ids");
+ assertEquals("{}", content);
+ }
}