use of io.servicetalk.concurrent.test.internal.TestSingleSubscriber in project servicetalk by apple.
the class RetryWhenTest method exceptionInTerminalCallsOnError.
@Test
void exceptionInTerminalCallsOnError() {
DeliberateException ex = new DeliberateException();
TestSingleSubscriber<Integer> subscriberRule = new TestSingleSubscriber<>();
source = new LegacyTestSingle<>(false, false);
toSource(source.retryWhen((times, cause) -> {
throw ex;
})).subscribe(subscriberRule);
source.onError(DELIBERATE_EXCEPTION);
assertThat(subscriberRule.awaitOnError(), is(ex));
assertEquals(1, ex.getSuppressed().length);
assertSame(DELIBERATE_EXCEPTION, ex.getSuppressed()[0]);
}
use of io.servicetalk.concurrent.test.internal.TestSingleSubscriber in project servicetalk by apple.
the class RetryTest method exceptionInTerminalCallsOnError.
@Test
void exceptionInTerminalCallsOnError() {
DeliberateException ex = new DeliberateException();
TestSingleSubscriber<Integer> subscriberRule = new TestSingleSubscriber<>();
source = new LegacyTestSingle<>(false, false);
toSource(source.retry((times, cause) -> {
throw ex;
})).subscribe(subscriberRule);
source.onError(DELIBERATE_EXCEPTION);
assertThat(subscriberRule.awaitOnError(), is(ex));
assertEquals(1, ex.getSuppressed().length);
assertSame(DELIBERATE_EXCEPTION, ex.getSuppressed()[0]);
}
Aggregations