Interface CompletableLastStep
-
- All Known Subinterfaces:
CompletableFirstStep
public interface CompletableLastStepProvides the ability to express expectations for the terminal signals (e.g.onCompleteoronError) of aCompletableSource.Subscriber.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StepVerifierexpectComplete()Declare an expectation thatCompletableSource.Subscriber.onComplete()onComplete} will be the next signal.StepVerifierexpectError()Declare an expectation thatonErrorwill be the next signal.StepVerifierexpectError(java.lang.Class<? extends java.lang.Throwable> errorClass)Declare an expectation thatonErrorwill be the next signal and it will be of typeerrorClass.StepVerifierexpectErrorConsumed(java.util.function.Consumer<java.lang.Throwable> errorConsumer)Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorConsumer.StepVerifierexpectErrorMatches(java.util.function.Predicate<java.lang.Throwable> errorPredicate)Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorPredicate.CompletableLastStepexpectNoSignals(java.time.Duration duration)Expect no signals indurationtime.CompletableLastStepthen(java.lang.Runnable r)InvokeRunnable.run()on the thread which invokesStepVerifier.verify().CompletableLastStepthenAwait(java.time.Duration duration)Wait for a time delay ofdurationon the thread which invokesStepVerifier.verify().StepVerifierthenCancel()Manually invokeCancellable.cancel()on theCancellablefromCompletableSource.Subscriber.onSubscribe(Cancellable).
-
-
-
Method Detail
-
expectNoSignals
CompletableLastStep expectNoSignals(java.time.Duration duration)
Expect no signals indurationtime.- 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 thatonErrorwill be the next signal.- Returns:
- An object which allows to verify all expectations.
-
expectErrorMatches
StepVerifier expectErrorMatches(java.util.function.Predicate<java.lang.Throwable> errorPredicate)
Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorPredicate.- Parameters:
errorPredicate- Will be invoked whenonErroris called and will raise aAssertionErrorif the predicate returnsfalse.- Returns:
- An object which allows to verify all expectations.
-
expectError
StepVerifier expectError(java.lang.Class<? extends java.lang.Throwable> errorClass)
Declare an expectation thatonErrorwill be the next signal and it will be of typeerrorClass.- Parameters:
errorClass- The type of error which is expected.- Returns:
- An object which allows to verify all expectations.
-
expectErrorConsumed
StepVerifier expectErrorConsumed(java.util.function.Consumer<java.lang.Throwable> errorConsumer)
Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorConsumer.- Parameters:
errorConsumer- Will be invoked whenonErroris called.- Returns:
- An object which allows to verify all expectations.
-
expectComplete
StepVerifier expectComplete()
Declare an expectation thatCompletableSource.Subscriber.onComplete()onComplete} will be the next signal.- Returns:
- An object which allows to verify all expectations.
-
thenCancel
StepVerifier thenCancel()
Manually invokeCancellable.cancel()on theCancellablefromCompletableSource.Subscriber.onSubscribe(Cancellable).- Returns:
- An object which allows to verify all expectations.
-
then
CompletableLastStep then(java.lang.Runnable r)
InvokeRunnable.run()on the thread which invokesStepVerifier.verify().- Parameters:
r- theRunnableto invoke.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenAwait
CompletableLastStep thenAwait(java.time.Duration duration)
Wait for a time delay ofdurationon the thread which invokesStepVerifier.verify().- Parameters:
duration- the duration to wait for.- Returns:
- An object which allows for subsequent expectations to be defined.
-
-