@Test
public void getHeadTest() {

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