use of reactor.core.publisher.Operators.MultiSubscriptionSubscriber in project reactor-core by reactor.
the class OperatorsTest method scanMultiSubscriptionSubscriber.
@Test
public void scanMultiSubscriptionSubscriber() {
CoreSubscriber<Integer> actual = new LambdaSubscriber<>(null, null, null, null);
MultiSubscriptionSubscriber<Integer, Integer> test = new MultiSubscriptionSubscriber<Integer, Integer>(actual) {
@Override
public void onNext(Integer t) {
}
};
Subscription parent = Operators.emptySubscription();
test.onSubscribe(parent);
assertThat(test.scan(Scannable.Attr.ACTUAL)).isSameAs(actual);
assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(parent);
test.request(34);
assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(34);
assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse();
test.cancel();
assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();
}
Aggregations