@Test
public void updateUnversionedDistributionWithErrorTest() {

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