@Test public void givenSourceAndTarget_shouldCreateMergePatch() { JsonMergeDiffExample jsonMergeDiffExample = new JsonMergeDiffExample(); JsonMergePatch mergePatch = jsonMergeDiffExample.createMergePatch(); JsonString jsonString = (JsonString) mergePatch.toJsonValue(); assertThat(jsonString.getString()).isEqualToIgnoringCase("{\"colour\":\"red\"}"); }
public JsonMergePatch createMergePatch(){ JsonValue source = Json.createValue("{\"colour\":\"blue\"}"); JsonValue target = Json.createValue("{\"colour\":\"red\"}"); JsonMergePatch jsonMergePatch = Json.createMergeDiff(source, target); return jsonMergePatch; }
JsonMergeDiffExample extends JsonExample { public JsonMergePatch createMergePatch(){ JsonValue source = Json.createValue("{\"colour\":\"blue\"}"); JsonValue target = Json.createValue("{\"colour\":\"red\"}"); JsonMergePatch jsonMergePatch = Json.createMergeDiff(source, target); return jsonMergePatch; } }
JsonMergeDiffExample extends JsonExample { public JsonMergePatch createMergePatch(){ JsonValue source = Json.createValue("{\"colour\":\"blue\"}"); JsonValue target = Json.createValue("{\"colour\":\"red\"}"); JsonMergePatch jsonMergePatch = Json.createMergeDiff(source, target); return jsonMergePatch; }  }
JsonMergeDiffExample extends JsonExample { public JsonMergePatch createMergePatch(){ JsonValue source = Json.createValue("{\"colour\":\"blue\"}"); JsonValue target = Json.createValue("{\"colour\":\"red\"}"); JsonMergePatch jsonMergePatch = Json.createMergeDiff(source, target); return jsonMergePatch; }  JsonMergePatch createMergePatch(); }
JsonMergeDiffExample extends JsonExample { public JsonMergePatch createMergePatch(){ JsonValue source = Json.createValue("{\"colour\":\"blue\"}"); JsonValue target = Json.createValue("{\"colour\":\"red\"}"); JsonMergePatch jsonMergePatch = Json.createMergeDiff(source, target); return jsonMergePatch; }  JsonMergePatch createMergePatch();  }