Interface PublisherStep<T>

Type Parameters:
T - The type of PublisherSource.Subscriber.
All Superinterfaces:
PublisherLastStep
All Known Subinterfaces:
PublisherFirstStep<T>

public interface PublisherStep<T> extends PublisherLastStep
Provides the ability to express expectations for the PublisherSource.Subscriber.onNext(Object) stages of a Subscriber's lifecycle.
  • Method Details

    • expectNext

      PublisherStep<T> expectNext(@Nullable T signal)
      Declare an expectation that signal will be the next signal.
      Parameters:
      signal - The next signal which is expected.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNext

      PublisherStep<T> expectNext(T... signals)
      Declare an expectation that signals will be the next in-order sequence of signals.
      Parameters:
      signals - The next signals which are expected in-order.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNextSequence

      PublisherStep<T> expectNextSequence(Iterable<? extends T> signals)
      Declare an expectation that signals will be the next in-order sequence of signals.
      Parameters:
      signals - The next signals which are expected in-order.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNextMatches

      PublisherStep<T> expectNextMatches(Predicate<? super T> signalPredicate)
      Declare an expectation that onNext will be the next signal and evaluate it with signalPredicate.
      Parameters:
      signalPredicate - Will be invoked when onNext is called and will raise a AssertionError if the predicate returns false.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNextConsumed

      PublisherStep<T> expectNextConsumed(Consumer<? super T> signalConsumer)
      Declare an expectation that onNext will be the next signal and evaluate it with signalConsumer.
      Parameters:
      signalConsumer - Consumes the next onNext signal.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNext

      PublisherStep<T> expectNext(long n, Consumer<? super Iterable<? extends T>> signalsConsumer)
      Expect n onNext signals, and assert their values via signalsConsumer.
      Parameters:
      n - The number of onNext signals that are expected.
      signalsConsumer - A Consumer that accepts an Iterable which has n items.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNext

      PublisherStep<T> expectNext(long min, long max, Consumer<? super Iterable<? extends T>> signalsConsumer)
      Expect between [min, max] onNext signals, and assert their values via signalsConsumer.
      Parameters:
      min - The minimum number of onNext signals that are required before invoking signalsConsumer. If a terminal signal is processed and the number of accumulated onNext signals is >= this value the signalsConsumer will be invoked for verification, otherwise the expectation will fail.
      max - The maximum number of onNext signals that will be accumulated before invoking signalsConsumer.
      signalsConsumer - A Consumer that accepts an Iterable which has between [min, max] items and preforms verification.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNextCount

      PublisherStep<T> expectNextCount(long n)
      Expect between [min, max] onNext signals, and discard the values.
      Parameters:
      n - The number of onNext signals that are expected.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNextCount

      PublisherStep<T> expectNextCount(long min, long max)
      Expect between [min, max] onNext signals, and discard the values.
      Parameters:
      min - The minimum number of onNext signals that are required before. If a terminal signal is processed and the number of accumulated onNext signals is < this value, the expectation will fail.
      max - The maximum number of onNext signals that will be expected and ignored before moving on to the next expectation.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectNoSignals

      PublisherStep<T> expectNoSignals(Duration duration)
      Parameters:
      duration - The amount of time to wait for a signal.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • thenRequest

      PublisherStep<T> thenRequest(long n)
      Manually request more from the PublisherSource.Subscription.
      Parameters:
      n - The amount to request.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • then

      Invoke Runnable.run() on the thread which invokes StepVerifier.verify().
      Parameters:
      r - the Runnable to invoke.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • thenAwait

      PublisherStep<T> thenAwait(Duration duration)
      Wait for a time delay of duration on the thread which invokes StepVerifier.verify().
      Parameters:
      duration - the duration to wait for.
      Returns:
      An object which allows for subsequent expectations to be defined.