use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.
the class OnErrorResumeCompletableTest method testErrorSuppressOriginalException.
@Test
void testErrorSuppressOriginalException() {
subscriber = new TestCompletableSubscriber();
first = new TestCompletable();
DeliberateException ex = new DeliberateException();
toSource(first.onErrorResume(throwable -> {
throw ex;
})).subscribe(subscriber);
first.onError(DELIBERATE_EXCEPTION);
assertThat(subscriber.awaitOnError(), is(ex));
assertEquals(1, ex.getSuppressed().length);
assertSame(DELIBERATE_EXCEPTION, ex.getSuppressed()[0]);
}
use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.
the class OnErrorCompletableTest method setUp.
@BeforeEach
void setUp() {
subscriber = new TestCompletableSubscriber();
first = new TestCompletable();
}
use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.
the class IterableMergeCompletableDelayErrorTest method testCollectionFailFirstEvent.
@Test
void testCollectionFailFirstEvent() {
TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
collectionHolder.init(2).listen(subscriber).fail(1);
assertThat(subscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
collectionHolder.complete(0, 2);
assertThat(subscriber.awaitOnError(), is(DELIBERATE_EXCEPTION));
}
use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.
the class IterableMergeCompletableDelayErrorTest method testIterableMergeWithOne.
@Test
void testIterableMergeWithOne() {
TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
iterableHolder.init(1).listen(subscriber).completeAll();
subscriber.awaitOnComplete();
}
use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.
the class IterableMergeCompletableDelayErrorTest method testCollectionCompletion.
@Test
void testCollectionCompletion() {
TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
collectionHolder.init(2).listen(subscriber).completeAll();
subscriber.awaitOnComplete();
}
Aggregations