/** Test of toJson method, of class Patch. */ @Test public void testToJson() throws Exception { JsonPatch instance = new JsonPatch(); instance.addOperation(new Operation(Op.replace, "name", "Ged corrigée")); instance.addOperation(new Operation(Op.replace, "versionning", "false")); instance.addOperation(new Operation(Op.remove, "xmlForm", "")); String expResult = "[{\"op\":\"replace\",\"path\":\"name\",\"value\":\"Ged " + "corrigée\"},{\"op\":\"replace\",\"path\":\"versionning\",\"value\":\"false\"},{" + "\"op\":\"remove\",\"path\":\"xmlForm\",\"value\":\"\"}]"; String result = instance.toJson(); assertThat(result, is(expResult)); }