public static interface StepVerifier.LastStep
Modifier and Type | Method and Description |
---|---|
StepVerifier |
consumeErrorWith(java.util.function.Consumer<Throwable> consumer)
Expect an error and consume with the given consumer.
|
StepVerifier |
expectComplete()
Expect the completion signal.
|
StepVerifier |
expectError()
Expect an unspecified error.
|
StepVerifier |
expectError(Class<? extends Throwable> clazz)
Expect an error of the specified type.
|
StepVerifier |
expectErrorMatches(java.util.function.Predicate<Throwable> predicate)
Expect an error and evaluate with the given predicate.
|
StepVerifier |
expectErrorMessage(String errorMessage)
Expect an error with the specified message.
|
StepVerifier |
thenCancel()
Cancel the underlying subscription.
|
java.time.Duration |
verifyComplete()
Trigger the
verification , expecting a completion signal
as terminal event. |
java.time.Duration |
verifyError()
Trigger the
verification , expecting an unspecified error
as terminal event. |
java.time.Duration |
verifyError(Class<? extends Throwable> clazz)
Trigger the
verification , expecting an error of the specified
type as terminal event. |
java.time.Duration |
verifyErrorMatches(java.util.function.Predicate<Throwable> predicate)
Trigger the
verification , expecting an error that matches
the given predicate as terminal event. |
java.time.Duration |
verifyErrorMessage(String errorMessage)
Trigger the
verification , expecting an error with the
specified messagee as terminal event. |
StepVerifier consumeErrorWith(java.util.function.Consumer<Throwable> consumer)
AssertionError
s thrown by the consumer will be rethrown during verification.consumer
- the consumer for the exceptionStepVerifier expectError()
Subscriber.onError(Throwable)
StepVerifier expectError(Class<? extends Throwable> clazz)
clazz
- the expected error typeSubscriber.onError(Throwable)
StepVerifier expectErrorMessage(String errorMessage)
errorMessage
- the expected error messageSubscriber.onError(Throwable)
StepVerifier expectErrorMatches(java.util.function.Predicate<Throwable> predicate)
predicate
- the predicate to test on the next received errorSubscriber.onError(Throwable)
StepVerifier expectComplete()
Subscriber.onComplete()
StepVerifier thenCancel()
Subscription.cancel()
java.time.Duration verifyError()
verification
, expecting an unspecified error
as terminal event.
This is a convenience method that calls StepVerifier.verify()
in addition to the
expectation. Explicitly use the expect method and verification method
separately if you need something more specific (like activating logging or
putting a timeout).
Duration
of the verificationexpectError()
,
StepVerifier.verify()
,
Subscriber.onError(Throwable)
java.time.Duration verifyError(Class<? extends Throwable> clazz)
verification
, expecting an error of the specified
type as terminal event.
This is a convenience method that calls StepVerifier.verify()
in addition to the
expectation. Explicitly use the expect method and verification method
separately if you need something more specific (like activating logging or
putting a timeout).
clazz
- the expected error typeDuration
of the verificationexpectError(Class)
,
StepVerifier.verify()
,
Subscriber.onError(Throwable)
java.time.Duration verifyErrorMessage(String errorMessage)
verification
, expecting an error with the
specified messagee as terminal event.
This is a convenience method that calls StepVerifier.verify()
in addition to the
expectation. Explicitly use the expect method and verification method
separately if you need something more specific (like activating logging or
putting a timeout).
errorMessage
- the expected error messageDuration
of the verificationexpectErrorMessage(String)
,
StepVerifier.verify()
,
Subscriber.onError(Throwable)
java.time.Duration verifyErrorMatches(java.util.function.Predicate<Throwable> predicate)
verification
, expecting an error that matches
the given predicate as terminal event.
This is a convenience method that calls StepVerifier.verify()
in addition to the
expectation. Explicitly use the expect method and verification method
separately if you need something more specific (like activating logging or
putting a timeout).
predicate
- the predicate to test on the next received errorDuration
of the verificationexpectErrorMatches(Predicate)
,
StepVerifier.verify()
,
Subscriber.onError(Throwable)
java.time.Duration verifyComplete()
verification
, expecting a completion signal
as terminal event.
This is a convenience method that calls StepVerifier.verify()
in addition to the
expectation. Explicitly use the expect method and verification method
separately if you need something more specific (like activating logging or
putting a timeout).
Duration
of the verificationexpectComplete()
,
StepVerifier.verify()
,
Subscriber.onComplete()