@Test
public void updateBranchWithIncorrectPathTest() {

    //Setup:
    JSONObject branch = new JSONObject().element("@id", BRANCH_IRI);
    doThrow(new IllegalArgumentException()).when(catalogManager).updateBranch(eq(vf.createIRI(LOCAL_IRI)), eq(vf.createIRI(ERROR_IRI)), any(Branch.class));
    Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(ERROR_IRI)
            + "/branches/" + encode(BRANCH_IRI))
            .request().put(Entity.json(branch.toString()));
    assertEquals(response.getStatus(), 400);
}