public class EventValidator extends Object implements EventMessageHandler
Constructor and Description |
---|
EventValidator(EventBus eventBus,
FieldFilter fieldFilter)
Initializes the event validator to monitor the given
eventBus . |
Modifier and Type | Method and Description |
---|---|
void |
assertPublishedEvents(Object... expected)
Assert that the given
expected events have been published. |
void |
assertPublishedEventsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
Asserts that events have been published matching the given
matcher . |
Object |
handle(EventMessage event)
Process the given event.
|
void |
startRecording()
Starts recording event published by the event bus.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prepareReset, supportsReset
canHandle, getTargetType
public EventValidator(EventBus eventBus, FieldFilter fieldFilter)
eventBus
.eventBus
- the event bus to monitorfieldFilter
- the filter describing the Fields to include in a comparisonpublic void assertPublishedEventsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
matcher
.matcher
- The matcher that will validate the actual eventspublic void assertPublishedEvents(Object... expected)
expected
events have been published.expected
- the events that must have been published.public Object handle(EventMessage event)
EventMessageHandler
handle
in interface EventMessageHandler
handle
in interface MessageHandler<EventMessage<?>>
event
- the event to handlepublic void startRecording()
Copyright © 2010–2019. All rights reserved.