@Test public void testTransformToMultiWithExceptionThrownByMapper() { Uni.createFrom().item(1) .onItem().transformToMulti(x -> { throw new IllegalStateException("boom"); }) .subscribe().withSubscriber(AssertSubscriber.create(10)) .await() .assertHasFailedWith(IllegalStateException.class, "boom") .assertHasNotReceivedAnyItem(); }
@Override public void subscribe(MultiSubscriber<? super O> subscriber) { if (subscriber == null) { throw new NullPointerException("The subscriber must not be `null`"); } AbstractUni.subscribe(upstream, new FlatMapPublisherSubscriber<>(subscriber, mapper)); }
UniOnItemTransformToMulti extends AbstractMulti<O> { @Override public void subscribe(MultiSubscriber<? super O> subscriber) { if (subscriber == null) { throw new NullPointerException("The subscriber must not be `null`"); } AbstractUni.subscribe(upstream, new FlatMapPublisherSubscriber<>(subscriber, mapper)); } }
UniOnItemTransformToMulti extends AbstractMulti<O> { @Override public void subscribe(MultiSubscriber<? super O> subscriber) { if (subscriber == null) { throw new NullPointerException("The subscriber must not be `null`"); } AbstractUni.subscribe(upstream, new FlatMapPublisherSubscriber<>(subscriber, mapper)); } UniOnItemTransformToMulti(Uni<I> upstream, Function<? super I, ? extends Publisher<? extends O>> mapper); }
UniOnItemTransformToMulti extends AbstractMulti<O> { @Override public void subscribe(MultiSubscriber<? super O> subscriber) { if (subscriber == null) { throw new NullPointerException("The subscriber must not be `null`"); } AbstractUni.subscribe(upstream, new FlatMapPublisherSubscriber<>(subscriber, mapper)); } UniOnItemTransformToMulti(Uni<I> upstream, Function<? super I, ? extends Publisher<? extends O>> mapper); @Override void subscribe(MultiSubscriber<? super O> subscriber); }
UniOnItemTransformToMulti extends AbstractMulti<O> { @Override public void subscribe(MultiSubscriber<? super O> subscriber) { if (subscriber == null) { throw new NullPointerException("The subscriber must not be `null`"); } AbstractUni.subscribe(upstream, new FlatMapPublisherSubscriber<>(subscriber, mapper)); } UniOnItemTransformToMulti(Uni<I> upstream, Function<? super I, ? extends Publisher<? extends O>> mapper); @Override void subscribe(MultiSubscriber<? super O> subscriber);  }