@Test public void createWithError() { Exception failure = new Exception("Boom"); PublisherStage<Object> boom = factory.create(null, () -> failure); boom.get().subscribe().withSubscriber(AssertSubscriber.create()) .assertHasFailedWith(Exception.class, "Boom"); }
@Override public <O> PublisherStage<O> create(Engine engine, Stage.Failed stage) { Throwable error = Objects.requireNonNull(Objects.requireNonNull(stage).getError()); return () -> Multi.createFrom().failure(error); }
FailedPublisherStageFactory implements PublisherStageFactory<Stage.Failed> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.Failed stage) { Throwable error = Objects.requireNonNull(Objects.requireNonNull(stage).getError()); return () -> Multi.createFrom().failure(error); } }
FailedPublisherStageFactory implements PublisherStageFactory<Stage.Failed> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.Failed stage) { Throwable error = Objects.requireNonNull(Objects.requireNonNull(stage).getError()); return () -> Multi.createFrom().failure(error); }  }
FailedPublisherStageFactory implements PublisherStageFactory<Stage.Failed> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.Failed stage) { Throwable error = Objects.requireNonNull(Objects.requireNonNull(stage).getError()); return () -> Multi.createFrom().failure(error); }  @Override PublisherStage<O> create(Engine engine, Stage.Failed stage); }
FailedPublisherStageFactory implements PublisherStageFactory<Stage.Failed> { @Override public <O> PublisherStage<O> create(Engine engine, Stage.Failed stage) { Throwable error = Objects.requireNonNull(Objects.requireNonNull(stage).getError()); return () -> Multi.createFrom().failure(error); }  @Override PublisherStage<O> create(Engine engine, Stage.Failed stage);  }