use of io.servicetalk.concurrent.Cancellable.IGNORE_CANCEL in project servicetalk by apple.
the class SourceAdaptersTest method singleFromSourceError.
@Test
void singleFromSourceError() {
SingleSource<Integer> src = s -> {
s.onSubscribe(IGNORE_CANCEL);
s.onError(DELIBERATE_EXCEPTION);
};
Future<Integer> future = fromSource(src).toFuture();
Exception e = assertThrows(ExecutionException.class, () -> future.get());
assertThat(e.getCause(), sameInstance(DELIBERATE_EXCEPTION));
}
Aggregations