Interface SingleLastStep<T>

Type Parameters:
T - The type of SingleSource.Subscriber.
All Known Subinterfaces:
SingleFirstStep<T>

public interface SingleLastStep<T>
Provides the ability to express expectations for the terminal signals (e.g. onSuccess or onError) of a SingleSource.Subscriber.
  • Method Details

    • expectNoSignals

      SingleLastStep<T> expectNoSignals(Duration duration)
      Expect no signals in duration time.
      Parameters:
      duration - The amount of time to assert that no signals are received.
      Returns:
      An object which allows for subsequent expectations to be defined.
    • expectError

      StepVerifier expectError()
      Declare an expectation that onError will be the next signal.
      Returns:
      An object which allows to verify all expectations.
    • expectErrorMatches

      StepVerifier expectErrorMatches(Predicate<Throwable> errorPredicate)
      Declare an expectation that onError will be the next signal and evaluate it with errorPredicate.
      Parameters:
      errorPredicate - Will be invoked when onError is called and will raise a AssertionError if the predicate returns false.
      Returns:
      An object which allows to verify all expectations.
    • expectError

      StepVerifier expectError(Class<? extends Throwable> errorClass)
      Declare an expectation that onError will be the next signal and it will be of type errorClass.
      Parameters:
      errorClass - The type of error which is expected.
      Returns:
      An object which allows to verify all expectations.
    • expectErrorConsumed

      StepVerifier expectErrorConsumed(Consumer<Throwable> errorConsumer)
      Declare an expectation that onError will be the next signal and evaluate it with errorConsumer.
      Parameters:
      errorConsumer - Will be invoked when onError is called.
      Returns:
      An object which allows to verify all expectations.
    • expectSuccess

      StepVerifier expectSuccess()
      Declare an expectation that onSuccess will be the next signal.
      Returns:
      An object which allows to verify all expectations.
    • expectSuccess

      StepVerifier expectSuccess(@Nullable T onSuccess)
      Declare an expectation that onSuccess will be the next signal.
      Parameters:
      onSuccess - The expected value of onSuccess.
      Returns:
      An object which allows to verify all expectations.
    • expectSuccessMatches

      StepVerifier expectSuccessMatches(Predicate<? super T> onSuccessPredicate)
      Declare an expectation that onSuccess will be the next signal and verify it with onSuccessPredicate.
      Parameters:
      onSuccessPredicate - Used to verify onSuccess.
      Returns:
      An object which allows to verify all expectations.
    • expectSuccessConsumed

      StepVerifier expectSuccessConsumed(Consumer<? super T> onSuccessConsumer)
      Declare an expectation that onSuccess will be the next signal and verify it with onSuccessConsumer.
      Parameters:
      onSuccessConsumer - Used to verify onSuccess.
      Returns:
      An object which allows to verify all expectations.
    • thenCancel

      StepVerifier thenCancel()
      Returns:
      An object which allows to verify all expectations.
    • 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

      SingleLastStep<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.