Interface SingleLastStep<T>
- Type Parameters:
T- The type ofSingleSource.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 Summary
Modifier and TypeMethodDescriptionDeclare an expectation thatonErrorwill be the next signal.expectError(Class<? extends Throwable> errorClass) Declare an expectation thatonErrorwill be the next signal and it will be of typeerrorClass.expectErrorConsumed(Consumer<Throwable> errorConsumer) Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorConsumer.expectErrorMatches(Predicate<Throwable> errorPredicate) Declare an expectation thatonErrorwill be the next signal and evaluate it witherrorPredicate.expectNoSignals(Duration duration) Expect no signals indurationtime.Declare an expectation thatonSuccesswill be the next signal.expectSuccess(T onSuccess) Declare an expectation thatonSuccesswill be the next signal.expectSuccessConsumed(Consumer<? super T> onSuccessConsumer) Declare an expectation thatonSuccesswill be the next signal and verify it withonSuccessConsumer.expectSuccessMatches(Predicate<? super T> onSuccessPredicate) Declare an expectation thatonSuccesswill be the next signal and verify it withonSuccessPredicate.InvokeRunnable.run()on the thread which invokesStepVerifier.verify().Wait for a time delay ofdurationon the thread which invokesStepVerifier.verify().Manually invokeCancellable.cancel()on theCancellablefromSingleSource.Subscriber.onSubscribe(Cancellable).
-
Method Details
-
expectNoSignals
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
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
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
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.
-
expectSuccess
StepVerifier expectSuccess()Declare an expectation thatonSuccesswill be the next signal.- Returns:
- An object which allows to verify all expectations.
-
expectSuccess
Declare an expectation thatonSuccesswill be the next signal.- Parameters:
onSuccess- The expected value ofonSuccess.- Returns:
- An object which allows to verify all expectations.
-
expectSuccessMatches
Declare an expectation thatonSuccesswill be the next signal and verify it withonSuccessPredicate.- Parameters:
onSuccessPredicate- Used to verifyonSuccess.- Returns:
- An object which allows to verify all expectations.
-
expectSuccessConsumed
Declare an expectation thatonSuccesswill be the next signal and verify it withonSuccessConsumer.- Parameters:
onSuccessConsumer- Used to verifyonSuccess.- Returns:
- An object which allows to verify all expectations.
-
thenCancel
StepVerifier thenCancel()Manually invokeCancellable.cancel()on theCancellablefromSingleSource.Subscriber.onSubscribe(Cancellable).- Returns:
- An object which allows to verify all expectations.
-
then
InvokeRunnable.run()on the thread which invokesStepVerifier.verify().- Parameters:
r- theRunnableto invoke.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenAwait
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.
-