### Question:
QueryServiceInfo extends CatalogQuery { @Override public String JSON2(boolean isArray, boolean isEmbed) { if (serviceInfo == null) { return "\"serviceInfo\": null"; } StringBuilder sb = new StringBuilder(); sb.append("\"serviceInfo\": "); sb.append("\n"); Map<String, String> valueMap = new HashMap<>(); Service service = serviceInfo.getService(); put(valueMap, "ID", null == serviceInfo ? null : serviceInfo.getId()); put(valueMap, "SERVICE_INPUT", null == serviceInfo ? null : serviceInfo.getServiceInput()); put(valueMap, "SERVICE_PROPERTIES", null == serviceInfo ? null : serviceInfo.getServiceProperties()); String subitem = new QueryServiceArtifact(service.getServiceArtifactList()).JSON2(true, true); valueMap.put("_SERVICEARTIFACT_", subitem.replaceAll("(?m)^", "\t\t")); sb.append(this.setTemplate(TEMPLATE, valueMap)); sb.append("}"); return sb.toString(); } QueryServiceInfo();  QueryServiceInfo(List<ServiceInfo> serviceInfos); ServiceInfo getServiceInfo(); void setServiceInfo(ServiceInfo serviceInfo); @Override String toString(); @Override String JSON2(boolean isArray, boolean isEmbed);  }### Answer:
@Test public void serviceInfoTest() { QueryServiceInfo queryServiceInfo = new QueryServiceInfo(createList()); String jsonResult = queryServiceInfo.JSON2(true, false); String serviceInfo = jsonResult.substring(jsonResult.indexOf("{"), jsonResult.length()); Assertions.assertThat(JsonPathUtil.getInstance().locateResult(serviceInfo, "$.id").get()).isEqualTo("1"); }