Class PublishedEventsAssert.PublishedEventAssert<T>
java.lang.Object
org.springframework.modulith.test.PublishedEventsAssert.PublishedEventAssert<T>
- Enclosing class:
- PublishedEventsAssert
Assertions further qualifying the expected events.
- Author:
- Oliver Drotbohm
-
Method Summary
-
Method Details
-
matching
Asserts that at least one event matches the given predicate.- Parameters:
predicate
- must not be null.- Returns:
- will never be null.
-
matching
public <S> PublishedEventsAssert.PublishedEventAssert<T> matching(Function<T, S> function, Predicate<? super S> predicate) Asserts that at least one event exists for which the value extracted by the givenFunction
matches the givenPredicate
.- Type Parameters:
S
- the type of the value to be matched.- Parameters:
function
- the extractor function, must not be null.predicate
- thePredicate
the extracted value is supposed to match. Must not be null.- Returns:
- will never be null.
-
matching
public <S> PublishedEventsAssert.PublishedEventAssert<T> matching(Function<T, S> function, @Nullable S value) Asserts that at least one event exists for which the value extracted by the givenFunction
matches the given one.- Type Parameters:
S
- the type of the value to be matched- Parameters:
function
- the extractor function, must not be null.value
- the expected value, can be null.- Returns:
- will never be null.
-
and
Syntactic sugar to start a new assertion on a different type of event.- Returns:
- will never be null.
-