Class DefaultPublishedEvents
java.lang.Object
org.springframework.modulith.test.DefaultPublishedEvents
- All Implemented Interfaces:
EventListener
,ApplicationListener<ApplicationEvent>
,PublishedEvents
class DefaultPublishedEvents
extends Object
implements PublishedEvents, ApplicationListener<ApplicationEvent>
Default implementation of
PublishedEvents
.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.modulith.test.PublishedEvents
PublishedEvents.TypedPublishedEvents<T>
-
Constructor Summary
ConstructorDescriptionCreates a new, emptyDefaultPublishedEvents
instance.DefaultPublishedEvents
(Collection<? extends Object> events) Creates a newDefaultPublishedEvents
instance with the given events. -
Method Summary
Modifier and TypeMethodDescriptionReturns all application events of the given type that were fired during the test execution.void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.modulith.test.PublishedEvents
eventOfTypeWasPublished
-
Constructor Details
-
DefaultPublishedEvents
DefaultPublishedEvents()Creates a new, emptyDefaultPublishedEvents
instance. -
DefaultPublishedEvents
DefaultPublishedEvents(Collection<? extends Object> events) Creates a newDefaultPublishedEvents
instance with the given events.- Parameters:
events
- must not be null.
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceApplicationListener<ApplicationEvent>
-
ofType
Description copied from interface:PublishedEvents
Returns all application events of the given type that were fired during the test execution.- Specified by:
ofType
in interfacePublishedEvents
- Type Parameters:
T
- the event type- Parameters:
type
- must not be null.- Returns:
-