@Test
public void getDifferenceTest() {

    Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI)
            + "/branches/" + encode(BRANCH_IRI) + "/difference")
            .queryParam("targetId", BRANCH_IRI).request().get();
    assertEquals(response.getStatus(), 200);
    verify(catalogManager, times(2)).getHeadCommit(vf.createIRI(LOCAL_IRI), vf.createIRI(RECORD_IRI), vf.createIRI(BRANCH_IRI));
    verify(catalogManager).getDifference(vf.createIRI(COMMIT_IRIS[0]), vf.createIRI(COMMIT_IRIS[0]));
    try {
        JSONObject result = JSONObject.fromObject(response.readEntity(String.class));
        assertTrue(result.containsKey("additions"));
        assertTrue(result.containsKey("deletions"));
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}