Interface PublisherLastStep
- All Known Subinterfaces:
PublisherFirstStep<T>,PublisherStep<T>
public interface PublisherLastStep
Provides the ability to express expectations for the terminal signals (e.g.
onComplete or onError) of a PublisherSource.Subscriber.-
Method Summary
Modifier and TypeMethodDescriptionDeclare an expectation thatPublisherSource.Subscriber.onComplete()onComplete} will be the next signal.Declare 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.Manually invokeCancellable.cancel()on thePublisherSource.SubscriptionfromPublisherSource.Subscriber.onSubscribe(Subscription).
-
Method Details
-
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.
-
expectComplete
StepVerifier expectComplete()Declare an expectation thatPublisherSource.Subscriber.onComplete()onComplete} will be the next signal.- Returns:
- An object which allows to verify all expectations.
-
thenCancel
StepVerifier thenCancel()Manually invokeCancellable.cancel()on thePublisherSource.SubscriptionfromPublisherSource.Subscriber.onSubscribe(Subscription).- Returns:
- An object which allows to verify all expectations.
-