use of org.folio.inventory.common.domain.Failure in project mod-inventory by folio-org.
the class ExternalAuthorityCollectionFailureExamples method serverErrorWhenUpdatingAnInstanceTriggersFailureCallback.
@Test
public void serverErrorWhenUpdatingAnInstanceTriggersFailureCallback() throws InterruptedException, ExecutionException, TimeoutException {
AuthorityRecordCollection collection = createCollection();
CompletableFuture<Failure> failureCalled = new CompletableFuture<>();
collection.update(createAuthority(), success -> fail("Completion callback should not be called"), failureCalled::complete);
Failure failure = failureCalled.get(1000, TimeUnit.MILLISECONDS);
check(failure);
}
use of org.folio.inventory.common.domain.Failure in project mod-inventory by folio-org.
the class ExternalAuthorityCollectionFailureExamples method serverErrorWhenDeletingAllInstancesTriggersFailureCallback.
@Test
public void serverErrorWhenDeletingAllInstancesTriggersFailureCallback() throws InterruptedException, ExecutionException, TimeoutException {
AuthorityRecordCollection collection = createCollection();
CompletableFuture<Failure> failureCalled = new CompletableFuture<>();
collection.empty(success -> fail("Completion callback should not be called"), failureCalled::complete);
Failure failure = failureCalled.get(1000, TimeUnit.MILLISECONDS);
check(failure);
}
use of org.folio.inventory.common.domain.Failure in project mod-inventory by folio-org.
the class ExternalInstanceCollectionFailureExamples method serverErrorWhenGettingAllInstancesTriggersFailureCallback.
@Test
public void serverErrorWhenGettingAllInstancesTriggersFailureCallback() throws InterruptedException, ExecutionException, TimeoutException {
InstanceCollection collection = createCollection();
CompletableFuture<Failure> failureCalled = new CompletableFuture<>();
collection.findAll(PagingParameters.defaults(), success -> fail("Completion callback should not be called"), failureCalled::complete);
Failure failure = failureCalled.get(1000, TimeUnit.MILLISECONDS);
check(failure);
}
use of org.folio.inventory.common.domain.Failure in project mod-inventory by folio-org.
the class ExternalInstanceCollectionFailureExamples method serverErrorWhenFindingItemsTriggersFailureCallback.
@Test
public void serverErrorWhenFindingItemsTriggersFailureCallback() throws InterruptedException, ExecutionException, TimeoutException, UnsupportedEncodingException {
InstanceCollection collection = createCollection();
CompletableFuture<Failure> failureCalled = new CompletableFuture<>();
collection.findByCql("title=\"*Small Angry*\"", new PagingParameters(10, 0), success -> fail("Completion callback should not be called"), failureCalled::complete);
Failure failure = failureCalled.get(1000, TimeUnit.MILLISECONDS);
check(failure);
}
use of org.folio.inventory.common.domain.Failure in project mod-inventory by folio-org.
the class ExternalInstanceCollectionFailureExamples method serverErrorWhenUpdatingAnInstanceTriggersFailureCallback.
@Test
public void serverErrorWhenUpdatingAnInstanceTriggersFailureCallback() throws InterruptedException, ExecutionException, TimeoutException {
InstanceCollection collection = createCollection();
CompletableFuture<Failure> failureCalled = new CompletableFuture<>();
collection.update(createInstance(), success -> fail("Completion callback should not be called"), failureCalled::complete);
Failure failure = failureCalled.get(1000, TimeUnit.MILLISECONDS);
check(failure);
}
Aggregations