@Test
public void updateVersionedDistributionWithIncorrectPathTest() {

    // Setup:
    JSONObject distribution = new JSONObject().element("@id", DISTRIBUTION_IRI);
    doThrow(new IllegalArgumentException()).when(catalogManager).updateVersionedDistribution(eq(vf.createIRI(LOCAL_IRI)), eq(vf.createIRI(RECORD_IRI)), eq(vf.createIRI(ERROR_IRI)), any(Distribution.class));
    Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(RECORD_IRI)
            + "/versions/" + encode(ERROR_IRI) + "/distributions/" + encode(DISTRIBUTION_IRI))
            .request().put(Entity.json(distribution.toString()));
    assertEquals(response.getStatus(), 400);
}