use of org.folio.rest.jaxrs.model.ResourceBulkFetchCollection in project mod-kb-ebsco-java by folio-org.
the class EholdingsResourcesImplTest method shouldReturnErrorWhenRMApiFails.
@Test
public void shouldReturnErrorWhenRMApiFails() throws IOException, URISyntaxException {
mockGet(new RegexPattern(MANAGED_PACKAGE_ENDPOINT + "/titles.*"), SC_INTERNAL_SERVER_ERROR);
String postBody = readFile("requests/kb-ebsco/resource/post-resources-bulk.json");
final ResourceBulkFetchCollection bulkFetchCollection = postWithOk(RESOURCES_BULK_FETCH, postBody, STUB_TOKEN_HEADER).as(ResourceBulkFetchCollection.class);
assertThat(bulkFetchCollection.getIncluded().size(), equalTo(0));
assertThat(bulkFetchCollection.getMeta().getFailed().getResources().size(), equalTo(1));
assertThat(bulkFetchCollection.getMeta().getFailed().getResources().get(0), equalTo("19-3964-762169"));
}
Aggregations