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