Package reactor.test
Interface StepVerifier.Assertions
- Enclosing interface:
- StepVerifier
public static interface StepVerifier.Assertions
Exposes post-verification state assertions.
-
Method Summary
Modifier and TypeMethodDescriptionhasDiscarded(Object... values) Assert that the tested publisher has discarded at least all of the provided elements to thediscardhook, in any order.Assert that the tested publisher has discarded at least one element to thediscardhook.hasDiscardedElementsMatching(Predicate<Collection<Object>> matcher) Assert that the tested publisher has discarded one or more elements to thediscardhook, and check that the collection of discarded elements matches a predicate.hasDiscardedElementsSatisfying(Consumer<Collection<Object>> consumer) Assert that the tested publisher has discarded one or more elements to thediscardhook, and assert them as a collection.hasDiscardedExactly(Object... values) Assert that the tested publisher has discarded all of the provided elements to thediscardhook, in any order, and that no other elements were dropped.hasDropped(Object... values) Assert that the tested publisher has dropped at least all of the provided elements to theHooks.onNextDropped(Consumer)hook, in any order.Assert that the tested publisher has dropped at least one element to theHooks.onNextDropped(Consumer)hook.hasDroppedErrorMatching(Predicate<Throwable> matcher) Assert that the tested publisher has dropped exactly one error matching the given predicate to theHooks.onErrorDropped(Consumer)hook.hasDroppedErrorOfType(Class<? extends Throwable> clazz) Assert that the tested publisher has dropped exactly one error of the given type to theHooks.onErrorDropped(Consumer)hook.Assert that the tested publisher has dropped at least one error to theHooks.onErrorDropped(Consumer)hook.hasDroppedErrors(int n) Assert that the tested publisher has dropped exactly n errors to theHooks.onErrorDropped(Consumer)hook.hasDroppedErrorsMatching(Predicate<Collection<Throwable>> errorsConsumer) Assert that the tested publisher has dropped one or more errors to theHooks.onErrorDropped(Consumer)hook, and check that the collection of errors matches a predicate.hasDroppedErrorsSatisfying(Consumer<Collection<Throwable>> errorsConsumer) Assert that the tested publisher has dropped one or more errors to theHooks.onErrorDropped(Consumer)hook, and assert them as a collection.hasDroppedErrorWithMessage(String message) Assert that the tested publisher has dropped exactly one error with the exact provided message to theHooks.onErrorDropped(Consumer)hook.hasDroppedErrorWithMessageContaining(String messagePart) Assert that the tested publisher has dropped exactly one error with a message containing the provided string to theHooks.onErrorDropped(Consumer)hook.hasDroppedExactly(Object... values) Assert that the tested publisher has dropped all of the provided elements to theHooks.onNextDropped(Consumer)hook, in any order, and that no other elements were dropped.Assert that the tested publisher has not discarded any element to thediscardhook.Assert that the tested publisher has not dropped any element to theHooks.onNextDropped(Consumer)hook.Assert that the tested publisher has not dropped any error to theHooks.onErrorDropped(Consumer)hook.hasOperatorErrorMatching(Predicate<Throwable> matcher) Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error matches the given predicate.hasOperatorErrorOfType(Class<? extends Throwable> clazz) Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error is of the given type.Assert that the tested publisher has triggered theonOperatorErrorhook at least once.hasOperatorErrors(int n) Assert that the tested publisher has triggered theonOperatorErrorhook exactly n times.hasOperatorErrorsMatching(Predicate<Collection<Tuple2<Optional<Throwable>, Optional<?>>>> errorsConsumer) Assert that the tested publisher has triggered theonOperatorErrorhook once or more, and check that the collection of errors and their optionally associated data matches a predicate.hasOperatorErrorsSatisfying(Consumer<Collection<Tuple2<Optional<Throwable>, Optional<?>>>> errorsConsumer) Assert that the tested publisher has triggered theonOperatorErrorhook once or more, and assert the errors and optionally associated data as a collection.hasOperatorErrorWithMessage(String message) Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error has the exact provided message.hasOperatorErrorWithMessageContaining(String messagePart) Assert that the tested publisher has triggered theonOperatorErrorhook exactly once, with the error message containing the provided string.Assert that the whole verification took strictly less than the provided duration to execute.Assert that the whole verification took strictly more than the provided duration to execute.
-
Method Details
-
hasDroppedElements
StepVerifier.Assertions hasDroppedElements()Assert that the tested publisher has dropped at least one element to theHooks.onNextDropped(Consumer)hook. -
hasNotDroppedElements
StepVerifier.Assertions hasNotDroppedElements()Assert that the tested publisher has not dropped any element to theHooks.onNextDropped(Consumer)hook. -
hasDropped
Assert that the tested publisher has dropped at least all of the provided elements to theHooks.onNextDropped(Consumer)hook, in any order. -
hasDroppedExactly
Assert that the tested publisher has dropped all of the provided elements to theHooks.onNextDropped(Consumer)hook, in any order, and that no other elements were dropped. -
hasDiscardedElements
StepVerifier.Assertions hasDiscardedElements()Assert that the tested publisher has discarded at least one element to thediscardhook.Unlike
hasDroppedElements(), the discard hook can be invoked as part of normal operations, eg. when an element doesn't match a filter. -
hasNotDiscardedElements
StepVerifier.Assertions hasNotDiscardedElements()Assert that the tested publisher has not discarded any element to thediscardhook.Unlike
hasDroppedElements(), the discard hook can be invoked as part of normal operations, eg. when an element doesn't match a filter. -
hasDiscarded
Assert that the tested publisher has discarded at least all of the provided elements to thediscardhook, in any order.Unlike
hasDroppedElements(), the discard hook can be invoked as part of normal operations, eg. when an element doesn't match a filter. -
hasDiscardedExactly
Assert that the tested publisher has discarded all of the provided elements to thediscardhook, in any order, and that no other elements were dropped.Unlike
hasDroppedElements(), the discard hook can be invoked as part of normal operations, eg. when an element doesn't match a filter. -
hasDiscardedElementsMatching
Assert that the tested publisher has discarded one or more elements to thediscardhook, and check that the collection of discarded elements matches a predicate. -
hasDiscardedElementsSatisfying
Assert that the tested publisher has discarded one or more elements to thediscardhook, and assert them as a collection. -
hasDroppedErrors
StepVerifier.Assertions hasDroppedErrors()Assert that the tested publisher has dropped at least one error to theHooks.onErrorDropped(Consumer)hook. -
hasNotDroppedErrors
StepVerifier.Assertions hasNotDroppedErrors()Assert that the tested publisher has not dropped any error to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrors
Assert that the tested publisher has dropped exactly n errors to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrorOfType
Assert that the tested publisher has dropped exactly one error of the given type to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrorMatching
Assert that the tested publisher has dropped exactly one error matching the given predicate to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrorWithMessage
Assert that the tested publisher has dropped exactly one error with the exact provided message to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrorWithMessageContaining
Assert that the tested publisher has dropped exactly one error with a message containing the provided string to theHooks.onErrorDropped(Consumer)hook. -
hasDroppedErrorsSatisfying
Assert that the tested publisher has dropped one or more errors to theHooks.onErrorDropped(Consumer)hook, and assert them as a collection. -
hasDroppedErrorsMatching
Assert that the tested publisher has dropped one or more errors to theHooks.onErrorDropped(Consumer)hook, and check that the collection of errors matches a predicate. -
hasOperatorErrors
StepVerifier.Assertions hasOperatorErrors()Assert that the tested publisher has triggered theonOperatorErrorhook at least once. -
hasOperatorErrors
Assert that the tested publisher has triggered theonOperatorErrorhook exactly n times. -
hasOperatorErrorOfType
Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error is of the given type. -
hasOperatorErrorMatching
Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error matches the given predicate. -
hasOperatorErrorWithMessage
Assert that the tested publisher has triggered theonOperatorErrorhook exactly once and the error has the exact provided message. -
hasOperatorErrorWithMessageContaining
Assert that the tested publisher has triggered theonOperatorErrorhook exactly once, with the error message containing the provided string. -
hasOperatorErrorsSatisfying
StepVerifier.Assertions hasOperatorErrorsSatisfying(Consumer<Collection<Tuple2<Optional<Throwable>, Optional<?>>>> errorsConsumer) Assert that the tested publisher has triggered theonOperatorErrorhook once or more, and assert the errors and optionally associated data as a collection. -
hasOperatorErrorsMatching
StepVerifier.Assertions hasOperatorErrorsMatching(Predicate<Collection<Tuple2<Optional<Throwable>, Optional<?>>>> errorsConsumer) Assert that the tested publisher has triggered theonOperatorErrorhook once or more, and check that the collection of errors and their optionally associated data matches a predicate. -
tookLessThan
Assert that the whole verification took strictly less than the provided duration to execute.- Parameters:
d- the expected maximum duration of the verification
-
tookMoreThan
Assert that the whole verification took strictly more than the provided duration to execute.- Parameters:
d- the expected minimum duration of the verification
-