@Test
public void getDifferenceWithErrorTest() {

    // Setup:
    doThrow(new IllegalArgumentException()).when(catalogManager).getDifference(vf.createIRI(ERROR_IRI), vf.createIRI(COMMIT_IRIS[0]));
    Response response = target().path("commits/" + encode(ERROR_IRI) + "/difference")
            .queryParam("targetId", encode(COMMIT_IRIS[0])).request().get();
    assertEquals(response.getStatus(), 400);
    doThrow(new MobiException()).when(catalogManager).getDifference(vf.createIRI(COMMIT_IRIS[1]), vf.createIRI(COMMIT_IRIS[0]));
    response = target().path("commits/" + encode(COMMIT_IRIS[1]) + "/difference")
            .queryParam("targetId", encode(COMMIT_IRIS[0])).request().get();
    assertEquals(response.getStatus(), 500);
    doThrow(new IllegalStateException()).when(catalogManager).getDifference(vf.createIRI(COMMIT_IRIS[1]), vf.createIRI(COMMIT_IRIS[0]));
    response = target().path("commits/" + encode(COMMIT_IRIS[1]) + "/difference")
            .queryParam("targetId", encode(COMMIT_IRIS[0])).request().get();
    assertEquals(response.getStatus(), 500);
}