public static void toJson(CheckList obj, java.util.Map<String, Object> json) { json.put("index", obj.getIndex()); if (obj.getList() != null) { JsonArray array = new JsonArray(); obj.getList().forEach(item -> array.add(item.toJson())); json.put("list", array); } } }
public static void toJson(ServiceEntry obj, java.util.Map<String, Object> json) { if (obj.getChecks() != null) { JsonArray array = new JsonArray(); obj.getChecks().forEach(item -> array.add(item.toJson())); json.put("checks", array); } if (obj.getNode() != null) { json.put("node", obj.getNode().toJson()); } if (obj.getService() != null) { json.put("service", obj.getService().toJson()); } } }
@Test public void testCheckCopy() { Check check = randomCheck(); checkCheck(check, new Check(check)); checkCheck(check, new Check(check.toJson())); }