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
oronError
) of aSingleSource.Subscriber
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StepVerifier
expectError()
Declare an expectation thatonError
will be the next signal.StepVerifier
expectError(java.lang.Class<? extends java.lang.Throwable> errorClass)
Declare an expectation thatonError
will be the next signal and it will be of typeerrorClass
.StepVerifier
expectErrorConsumed(java.util.function.Consumer<java.lang.Throwable> errorConsumer)
Declare an expectation thatonError
will be the next signal and evaluate it witherrorConsumer
.StepVerifier
expectErrorMatches(java.util.function.Predicate<java.lang.Throwable> errorPredicate)
Declare an expectation thatonError
will be the next signal and evaluate it witherrorPredicate
.SingleLastStep<T>
expectNoSignals(java.time.Duration duration)
Expect no signals induration
time.StepVerifier
expectSuccess()
Declare an expectation thatonSuccess
will be the next signal.StepVerifier
expectSuccess(T onSuccess)
Declare an expectation thatonSuccess
will be the next signal.StepVerifier
expectSuccessConsumed(java.util.function.Consumer<? super T> onSuccessConsumer)
Declare an expectation thatonSuccess
will be the next signal and verify it withonSuccessConsumer
.StepVerifier
expectSuccessMatches(java.util.function.Predicate<? super T> onSuccessPredicate)
Declare an expectation thatonSuccess
will be the next signal and verify it withonSuccessPredicate
.SingleLastStep<T>
then(java.lang.Runnable r)
InvokeRunnable.run()
on the thread which invokesStepVerifier.verify()
.SingleLastStep<T>
thenAwait(java.time.Duration duration)
Wait for a time delay ofduration
on the thread which invokesStepVerifier.verify()
.StepVerifier
thenCancel()
Manually invokeCancellable.cancel()
on theCancellable
fromSingleSource.Subscriber.onSubscribe(Cancellable)
.
-
-
-
Method Detail
-
expectNoSignals
SingleLastStep<T> expectNoSignals(java.time.Duration duration)
Expect no signals induration
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 thatonError
will 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 thatonError
will be the next signal and evaluate it witherrorPredicate
.- Parameters:
errorPredicate
- Will be invoked whenonError
is called and will raise aAssertionError
if 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 thatonError
will 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 thatonError
will be the next signal and evaluate it witherrorConsumer
.- Parameters:
errorConsumer
- Will be invoked whenonError
is called.- Returns:
- An object which allows to verify all expectations.
-
expectSuccess
StepVerifier expectSuccess()
Declare an expectation thatonSuccess
will be the next signal.- Returns:
- An object which allows to verify all expectations.
-
expectSuccess
StepVerifier expectSuccess(@Nullable T onSuccess)
Declare an expectation thatonSuccess
will be the next signal.- Parameters:
onSuccess
- The expected value ofonSuccess
.- Returns:
- An object which allows to verify all expectations.
-
expectSuccessMatches
StepVerifier expectSuccessMatches(java.util.function.Predicate<? super T> onSuccessPredicate)
Declare an expectation thatonSuccess
will be the next signal and verify it withonSuccessPredicate
.- Parameters:
onSuccessPredicate
- Used to verifyonSuccess
.- Returns:
- An object which allows to verify all expectations.
-
expectSuccessConsumed
StepVerifier expectSuccessConsumed(java.util.function.Consumer<? super T> onSuccessConsumer)
Declare an expectation thatonSuccess
will 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 theCancellable
fromSingleSource.Subscriber.onSubscribe(Cancellable)
.- Returns:
- An object which allows to verify all expectations.
-
then
SingleLastStep<T> then(java.lang.Runnable r)
InvokeRunnable.run()
on the thread which invokesStepVerifier.verify()
.- Parameters:
r
- theRunnable
to invoke.- Returns:
- An object which allows for subsequent expectations to be defined.
-
thenAwait
SingleLastStep<T> thenAwait(java.time.Duration duration)
Wait for a time delay ofduration
on the thread which invokesStepVerifier.verify()
.- Parameters:
duration
- the duration to wait for.- Returns:
- An object which allows for subsequent expectations to be defined.
-
-