CacheArgumentServices { String processSubFieldsOfArg(String[] path, String jsonArg) { try (JsonReader reader = Json.createReader(new StringReader(jsonArg))) { JsonValue jsonObject = reader.readObject(); for (String p : path) { logger.debug("Access to '{}' for '{}'", p, jsonObject); jsonObject = ((JsonObject) jsonObject).get(p); } return jsonObject.toString(); } }  String computeArgPart(String[] keys, List<String> jsonArgs, List<String> paramNames);  }
@Test public void testProcessSubFieldsOfArg() { System.out.println("processSubFieldsOfArg"); String[] path = new String[] {}; String jsonArg = "{\"a\":{\"b\":6}}"; String result = instance.processSubFieldsOfArg(path, jsonArg); assertThat(result).isEqualTo("{\"a\":{\"b\":6}}"); path = new String[] {"a"}; result = instance.processSubFieldsOfArg(path, jsonArg); assertThat(result).isEqualTo("{\"b\":6}"); path = new String[] {"a", "b"}; result = instance.processSubFieldsOfArg(path, jsonArg); assertThat(result).isEqualTo("6"); }