use of io.servicetalk.concurrent.internal.EmptySubscriptions.EMPTY_SUBSCRIPTION in project servicetalk by apple.
the class ReactiveStreamsAdaptersTest method completableToRSFromSourceError.
@Test
void completableToRSFromSourceError() {
CompletableSource source = s -> {
s.onSubscribe(EMPTY_SUBSCRIPTION);
s.onError(DELIBERATE_EXCEPTION);
};
verifyRSError(toRSPublisherFromSourceAndSubscribe(source));
}
use of io.servicetalk.concurrent.internal.EmptySubscriptions.EMPTY_SUBSCRIPTION in project servicetalk by apple.
the class SourceAdaptersTest method publisherFromSourceError.
@Test
void publisherFromSourceError() {
PublisherSource<Integer> src = s -> {
s.onSubscribe(EMPTY_SUBSCRIPTION);
s.onError(DELIBERATE_EXCEPTION);
};
Future<Integer> future = fromSource(src).firstOrElse(() -> null).toFuture();
Exception e = assertThrows(ExecutionException.class, () -> future.get());
assertThat(e.getCause(), sameInstance(DELIBERATE_EXCEPTION));
}
Aggregations