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 TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Returns allPublishedEvents.TypedPublishedEventsthat match the given predicate after applying the given mapping step.Returns allPublishedEvents.TypedPublishedEventsthat 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.since 0.3, usematching(Function, Predicate)instead.matchingValue(Function<T, S> mapper, @Nullable S value) Returns allPublishedEvents.TypedPublishedEventsthat match the given value after applying the given mapping step.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, spliteratorMethods 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:TypedEventsReturns all events of the given type.- Specified by:
ofTypein interfaceTypedEvents- Type Parameters:
S- the event type- Parameters:
type- must not be null.- Returns:
-
matching
Returns allPublishedEvents.TypedPublishedEventsthat 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.TypedPublishedEventsthat match the given predicate after applying the given mapping step.- Type Parameters:
S- the intermediate type to apply thePredicateon- Parameters:
mapper- the mapping step to extract a part of the original event subject to test for thePredicate. Must not be null.predicate- thePredicateto apply on the value extracted. Must not be null.- Returns:
- will never be null.
-
matching
@Deprecated(since="2.0", forRemoval=true) <S> PublishedEvents.TypedPublishedEvents<T> matching(Function<T, S> mapper, @Nullable S value) Deprecated, for removal: This API element is subject to removal in a future version.usematchingValue(Function, Object)instead.Returns allPublishedEvents.TypedPublishedEventsthat match the given value after applying the given mapping step.- Type Parameters:
S- the intermediate type to apply thePredicateon- 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.
-
matchingValue
Returns allPublishedEvents.TypedPublishedEventsthat match the given value after applying the given mapping step.- Type Parameters:
S- the intermediate type to apply thePredicateon- 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.
- Since:
- 2.0
-
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.TypedPublishedEventsthat match the given predicate after applying the given mapping step.
-
matchingValue(Function, Object)instead.