use of org.folio.holdingsiq.model.PackageData in project mod-kb-ebsco-java by folio-org.
the class EholdingsPackagesTest method shouldReturn400WhenPackageIsNotCustom.
@Test
public void shouldReturn400WhenPackageIsNotCustom() throws URISyntaxException, IOException {
PackageData packageData = mapper.readValue(getFile(CUSTOM_PACKAGE_STUB_FILE), PackageData.class).toBuilder().isCustom(false).build();
stubFor(get(PACKAGE_URL_PATTERN).willReturn(new ResponseDefinitionBuilder().withBody(mapper.writeValueAsString(packageData))));
JsonapiError error = deleteWithStatus(PACKAGES_PATH, SC_BAD_REQUEST, STUB_TOKEN_HEADER).as(JsonapiError.class);
assertErrorContainsTitle(error, "Package cannot be deleted");
}
Aggregations