Search in sources :

Example 1 with PackageData

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");
}
Also used : ResponseDefinitionBuilder(com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder) JsonapiError(org.folio.rest.jaxrs.model.JsonapiError) PackageData(org.folio.holdingsiq.model.PackageData) Test(org.junit.Test)

Aggregations

ResponseDefinitionBuilder (com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder)1 PackageData (org.folio.holdingsiq.model.PackageData)1 JsonapiError (org.folio.rest.jaxrs.model.JsonapiError)1 Test (org.junit.Test)1