- assertEquals(refProp.getStringValue("policy.onap.name"), "DCAE");
- 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"));
- }
-
- /**
- * Test getting prop value as a JSON Node / template.
- *
- * @throws IOException
- * when JSON parsing fails
- */
- @Test
- 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");
- assertNotNull(root);
- assertEquals(root.get("DC1").asText(), "Data Center 1");
- // Test composite key
- root = (ObjectNode) refProp.getJsonTemplate("ui.location", "default");
- assertNotNull(root);
- assertEquals(root.get("DC1").asText(), "Data Center 1");
- root = (ObjectNode) refProp.getJsonTemplate("ui.location", "");
- assertNull(root);