use of io.servicetalk.concurrent.api.TestSubscription in project servicetalk by apple.
the class FlushTest method testCancel.
@Test
void testCancel() {
final TestSubscription subscription = new TestSubscription();
source.onSubscribe(subscription);
subscriber.awaitSubscription().cancel();
verify(channel).eventLoop();
verifyNoMoreInteractions(channel);
assertThat(subscriber.pollOnNext(10, MILLISECONDS), is(nullValue()));
assertThat(subscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
assertTrue(subscription.isCancelled());
strategy.verifyWriteCancelled();
}
Aggregations