@Test public void givenPatchPath_shouldReplaceElement() { JsonPatchExample jsonPatchExample = new JsonPatchExample(); String series = jsonPatchExample.replace(); assertThat(series).isEqualToIgnoringCase("Spring 5"); }
public String replace() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch jsonPatch = builder.replace("/series/0", "Spring 5").build(); JsonObject newJsonObject = jsonPatch.apply(jsonObject); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonValue = (JsonString) pointer.getValue(newJsonObject); return jsonValue.getString(); }
JsonPatchExample extends JsonExample { public String replace() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch jsonPatch = builder.replace("/series/0", "Spring 5").build(); JsonObject newJsonObject = jsonPatch.apply(jsonObject); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonValue = (JsonString) pointer.getValue(newJsonObject); return jsonValue.getString(); } }
JsonPatchExample extends JsonExample { public String replace() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch jsonPatch = builder.replace("/series/0", "Spring 5").build(); JsonObject newJsonObject = jsonPatch.apply(jsonObject); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonValue = (JsonString) pointer.getValue(newJsonObject); return jsonValue.getString(); }  }
JsonPatchExample extends JsonExample { public String replace() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch jsonPatch = builder.replace("/series/0", "Spring 5").build(); JsonObject newJsonObject = jsonPatch.apply(jsonObject); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonValue = (JsonString) pointer.getValue(newJsonObject); return jsonValue.getString(); }  String replace(); JsonObject addAndRemove(); JsonObject move(); JsonObject copy(); JsonObject test(); JsonObject toJsonArray(); }
JsonPatchExample extends JsonExample { public String replace() { JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch jsonPatch = builder.replace("/series/0", "Spring 5").build(); JsonObject newJsonObject = jsonPatch.apply(jsonObject); JsonPointer pointer = Json.createPointer("/series/0"); JsonString jsonValue = (JsonString) pointer.getValue(newJsonObject); return jsonValue.getString(); }  String replace(); JsonObject addAndRemove(); JsonObject move(); JsonObject copy(); JsonObject test(); JsonObject toJsonArray();  }