use of reactor.core.publisher.ParallelMergeSequential.MergeSequentialMain in project reactor-core by reactor.
the class ParallelMergeSequentialTest method scanInnerSubscriber.
@Test
public void scanInnerSubscriber() {
CoreSubscriber<Integer> mainActual = new LambdaSubscriber<>(null, e -> {
}, null, null);
MergeSequentialMain<Integer> main = new MergeSequentialMain<>(mainActual, 2, 123, Queues.small());
MergeSequentialInner<Integer> test = new MergeSequentialInner<>(main, 456);
Subscription subscription = Operators.emptySubscription();
test.onSubscribe(subscription);
assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(subscription);
assertThat(test.scan(Scannable.Attr.ACTUAL)).isSameAs(main);
assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(456);
assertThat(test.scan(Scannable.Attr.BUFFERED)).isEqualTo(0);
assertThat(test.scan(Scannable.Attr.RUN_STYLE)).isSameAs(Scannable.Attr.RunStyle.SYNC);
assertThat(test.scan(Scannable.Attr.TERMINATED)).isFalse();
assertThat(test.scan(Scannable.Attr.ERROR)).isNull();
assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse();
test.cancel();
assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();
}
Aggregations