JsonParser implements ConfigTextParser { @Override public Map<String, String> parseText(String text) { JSONObject json = new JSONObject(text); Map<String, String> map = new HashMap<>(); for (String key : json.keySet()) { map.put(key, json.optString(key)); } return map; }  @Override Map<String, String> parseText(String text); @Override boolean accepts(String location, String content);  }
@Test public void parsesJsonOK() { String json = "{ \"uri.key\": \"https: + "\"integer.key\": 3600, \"string.key\": \"broadcast\", " + "\"float.key\": 2.4, \"boolean.key\": false }"; Map<String, String> map = new JsonParser().parseText(json); assertEquals("broadcast", map.get("string.key")); assertEquals("3600", map.get("integer.key")); assertEquals("2.4", map.get("float.key")); assertEquals("false", map.get("boolean.key")); assertEquals("https: }