Search in sources :

Example 1 with RequestsBatchAPI

use of org.folio.rest.impl.RequestsBatchAPI in project mod-circulation-storage by folio-org.

the class RequestBatchAPITest method willAbortBatchUpdateOnPopulateMetadataException.

@Test
public void willAbortBatchUpdateOnPopulateMetadataException() throws Exception {
    CompletableFuture<TextResponse> postCompleted = new CompletableFuture<>();
    new RequestsBatchAPI().postRequestStorageBatchRequests(null, null, result -> postCompleted.complete(new TextResponse(result.result().getStatus(), result.result().getEntity().toString())), null);
    TextResponse response = postCompleted.get(5, TimeUnit.SECONDS);
    assertThat(response.getStatusCode(), is(500));
    assertThat(response.getBody(), containsString("Cannot populate metadata"));
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) TextResponse(org.folio.rest.support.TextResponse) RequestsBatchAPI(org.folio.rest.impl.RequestsBatchAPI) Test(org.junit.Test)

Aggregations

CompletableFuture (java.util.concurrent.CompletableFuture)1 RequestsBatchAPI (org.folio.rest.impl.RequestsBatchAPI)1 TextResponse (org.folio.rest.support.TextResponse)1 Test (org.junit.Test)1