Search in sources :

Example 1 with MergeSequentialMain

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();
}
Also used : MergeSequentialMain(reactor.core.publisher.ParallelMergeSequential.MergeSequentialMain) MergeSequentialInner(reactor.core.publisher.ParallelMergeSequential.MergeSequentialInner) Subscription(org.reactivestreams.Subscription) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 Subscription (org.reactivestreams.Subscription)1 MergeSequentialInner (reactor.core.publisher.ParallelMergeSequential.MergeSequentialInner)1 MergeSequentialMain (reactor.core.publisher.ParallelMergeSequential.MergeSequentialMain)1