@Test public void ifValueIsMoved_shouldNotAmendOriginalJSON() { JsonPatchExample jsonPatchExample = new JsonPatchExample(); JsonObject jsonObject = jsonPatchExample.toJsonArray(); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonString = (JsonString) pointer.getValue(jsonObject); assertThat(jsonString.getString()).isEqualToIgnoringCase("Cognitive"); }
public JsonObject toJsonArray() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonArray jsonArray = builder.copy("/series/0", "/topics/0").build().toJsonArray(); return Json.createPatchBuilder(jsonArray).build().apply(jsonObject); }
JsonPatchExample extends JsonExample { public JsonObject toJsonArray() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonArray jsonArray = builder.copy("/series/0", "/topics/0").build().toJsonArray(); return Json.createPatchBuilder(jsonArray).build().apply(jsonObject); } }
JsonPatchExample extends JsonExample { public JsonObject toJsonArray() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonArray jsonArray = builder.copy("/series/0", "/topics/0").build().toJsonArray(); return Json.createPatchBuilder(jsonArray).build().apply(jsonObject); }  }
JsonPatchExample extends JsonExample { public JsonObject toJsonArray() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonArray jsonArray = builder.copy("/series/0", "/topics/0").build().toJsonArray(); return Json.createPatchBuilder(jsonArray).build().apply(jsonObject); }  String replace(); JsonObject addAndRemove(); JsonObject move(); JsonObject copy(); JsonObject test(); JsonObject toJsonArray(); }
JsonPatchExample extends JsonExample { public JsonObject toJsonArray() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonArray jsonArray = builder.copy("/series/0", "/topics/0").build().toJsonArray(); return Json.createPatchBuilder(jsonArray).build().apply(jsonObject); }  String replace(); JsonObject addAndRemove(); JsonObject move(); JsonObject copy(); JsonObject test(); JsonObject toJsonArray();  }