Interface PublishedEvents.TypedPublishedEvents<T>
- Type Parameters:
T
- the event type
- All Superinterfaces:
Iterable<T>
,TypedEvents
- Enclosing interface:
- PublishedEvents
All application events of a given type that were fired during a test execution.
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionReturns allPublishedEvents.TypedPublishedEvents
that match the given predicate after applying the given mapping step.Returns allPublishedEvents.TypedPublishedEvents
that match the given value after applying the given mapping step.Returns allPublishedEvents.TypedPublishedEvents
that match the given predicate.default <S> PublishedEvents.TypedPublishedEvents<T>
matchingMapped
(Function<T, S> mapper, Predicate<? super S> predicate) Deprecated, for removal: This API element is subject to removal in a future version.default <S extends T>
PublishedEvents.TypedPublishedEvents<S>Further constrain the event type for downstream assertions.Returns all events of the given type.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.springframework.modulith.test.TypedEvents
eventOfTypeWasPublished
-
Method Details
-
ofSubType
Further constrain the event type for downstream assertions.- Type Parameters:
S
-- Parameters:
subType
- the sub type- Returns:
- will never be null.
-
ofType
Description copied from interface:TypedEvents
Returns all events of the given type.- Specified by:
ofType
in interfaceTypedEvents
- Type Parameters:
S
- the event type- Parameters:
type
- must not be null.- Returns:
-
matching
Returns allPublishedEvents.TypedPublishedEvents
that match the given predicate.- Parameters:
predicate
- must not be null.- Returns:
- will never be null.
-
matching
<S> PublishedEvents.TypedPublishedEvents<T> matching(Function<T, S> mapper, Predicate<? super S> predicate) Returns allPublishedEvents.TypedPublishedEvents
that match the given predicate after applying the given mapping step.- Type Parameters:
S
- the intermediate type to apply thePredicate
on- Parameters:
mapper
- the mapping step to extract a part of the original event subject to test for thePredicate
. Must not be null.predicate
- thePredicate
to apply on the value extracted. Must not be null.- Returns:
- will never be null.
-
matching
Returns allPublishedEvents.TypedPublishedEvents
that match the given value after applying the given mapping step.- Type Parameters:
S
- the intermediate type to apply thePredicate
on- Parameters:
mapper
- the mapping step to extract a part of the original event subject to verify against the given value, must not be null.value
- the value expected as outcome of the mapping step, can be null.- Returns:
- will never be null.
-
matchingMapped
@Deprecated(forRemoval=true, since="0.3") default <S> PublishedEvents.TypedPublishedEvents<T> matchingMapped(Function<T, S> mapper, Predicate<? super S> predicate) Deprecated, for removal: This API element is subject to removal in a future version.since 0.3, usematching(Function, Predicate)
instead.Returns allPublishedEvents.TypedPublishedEvents
that match the given predicate after applying the given mapping step.
-
matching(Function, Predicate)
instead.