- 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
- public void shouldReturnJsonFromTemplate() throws IOException {
- //when
- JsonElement root = refProp.getJsonTemplate("ui.location.default");
-
- //then
- assertNotNull(root);
- assertTrue(root.isJsonObject());
- assertEquals(root.getAsJsonObject().get("DC1").getAsString(), "Data Center 1");
- }
-
- @Test
- public void shouldReturnJsonFromTemplate_2() throws IOException {
- //when
- JsonElement root = refProp.getJsonTemplate("ui.location", "default");
-
- //then
- assertNotNull(root);
- assertTrue(root.isJsonObject());
- assertEquals(root.getAsJsonObject().get("DC1").getAsString(), "Data Center 1");
- }
-
- @Test
- public void shouldReturnNullIfPropertyNotFound() throws IOException {
- //when
- JsonElement root = refProp.getJsonTemplate("ui.location", "");
-
- //then
- assertNull(root);