public class FixtureExecutionResultImpl<T> extends Object implements FixtureExecutionResult
Modifier and Type | Method and Description |
---|---|
FixtureExecutionResult |
expectActiveSagas(int expected)
Expect the given number of Sagas to be active (i.e.
|
FixtureExecutionResult |
expectAssociationWith(String associationKey,
Object associationValue)
Asserts that at least one of the active sagas is associated with the given
associationKey and
associationValue . |
FixtureExecutionResult |
expectDispatchedCommands(Object... expected)
Asserts that the given commands have been dispatched in exactly the order given.
|
FixtureExecutionResult |
expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends List<? super CommandMessage<?>>> matcher)
Asserts that the sagas dispatched commands as defined by the given
matcher . |
FixtureExecutionResult |
expectNoAssociationWith(String associationKey,
Object associationValue)
Asserts that at none of the active sagas is associated with the given
associationKey and
associationValue . |
FixtureExecutionResult |
expectNoDispatchedCommands()
Asserts that the sagas did not dispatch any commands.
|
FixtureExecutionResult |
expectNoScheduledEvents()
Assert that no events are scheduled for publication.
|
FixtureExecutionResult |
expectPublishedEvents(Object... expected)
Assert that the saga published events on the EventBus in the exact sequence of the given
expected
events. |
FixtureExecutionResult |
expectPublishedEventsMatching(org.hamcrest.Matcher<? extends List<? super EventMessage<?>>> matcher)
Assert that the saga published events on the EventBus as defined by the given
matcher . |
FixtureExecutionResult |
expectScheduledEvent(Duration duration,
Object applicationEvent)
Asserts that an event equal to the given ApplicationEvent has been scheduled for publication after the given
duration . |
FixtureExecutionResult |
expectScheduledEvent(Instant scheduledTime,
Object applicationEvent)
Asserts that an event equal to the given ApplicationEvent has been scheduled for publication at the given
scheduledTime . |
FixtureExecutionResult |
expectScheduledEventMatching(Duration duration,
org.hamcrest.Matcher<? super EventMessage<?>> matcher)
Asserts that an event matching the given
matcher has been scheduled to be published after the given
duration . |
FixtureExecutionResult |
expectScheduledEventMatching(Instant scheduledTime,
org.hamcrest.Matcher<? super EventMessage<?>> matcher)
Asserts that an event matching the given
matcher has been scheduled to be published at the given
scheduledTime . |
FixtureExecutionResult |
expectScheduledEventOfType(Duration duration,
Class<?> eventType)
Asserts that an event of the given
eventType has been scheduled for publication after the given
duration . |
FixtureExecutionResult |
expectScheduledEventOfType(Instant scheduledTime,
Class<?> eventType)
Asserts that an event of the given
eventType has been scheduled for publication at the given
scheduledTime . |
void |
startRecording()
Tells this class to start monitoring activity in infrastructure classes.
|
public void startRecording()
public FixtureExecutionResult expectActiveSagas(int expected)
FixtureExecutionResult
expectActiveSagas
in interface FixtureExecutionResult
expected
- the expected number of active events in the repositorypublic FixtureExecutionResult expectAssociationWith(String associationKey, Object associationValue)
FixtureExecutionResult
associationKey
and
associationValue
.expectAssociationWith
in interface FixtureExecutionResult
associationKey
- The key of the association to verifyassociationValue
- The value of the association to verifypublic FixtureExecutionResult expectNoAssociationWith(String associationKey, Object associationValue)
FixtureExecutionResult
associationKey
and
associationValue
.expectNoAssociationWith
in interface FixtureExecutionResult
associationKey
- The key of the association to verifyassociationValue
- The value of the association to verifypublic FixtureExecutionResult expectScheduledEventMatching(Duration duration, org.hamcrest.Matcher<? super EventMessage<?>> matcher)
FixtureExecutionResult
matcher
has been scheduled to be published after the given
duration
.expectScheduledEventMatching
in interface FixtureExecutionResult
duration
- The time to wait before the event should be publishedmatcher
- A matcher defining the event expected to be publishedpublic FixtureExecutionResult expectScheduledEvent(Duration duration, Object applicationEvent)
FixtureExecutionResult
duration
.
Note that the source attribute of the application event is ignored when comparing events. Events are compared
using an "equals" check on all fields in the events.expectScheduledEvent
in interface FixtureExecutionResult
duration
- The time to wait before the event should be publishedapplicationEvent
- The expected eventpublic FixtureExecutionResult expectScheduledEventOfType(Duration duration, Class<?> eventType)
FixtureExecutionResult
eventType
has been scheduled for publication after the given
duration
.expectScheduledEventOfType
in interface FixtureExecutionResult
duration
- The time to wait before the event should be publishedeventType
- The type of the expected eventpublic FixtureExecutionResult expectScheduledEventMatching(Instant scheduledTime, org.hamcrest.Matcher<? super EventMessage<?>> matcher)
FixtureExecutionResult
matcher
has been scheduled to be published at the given
scheduledTime
.
If the scheduledTime
is calculated based on the "current time", use the FixtureConfiguration.currentTime()
to get the time to use as "current time".expectScheduledEventMatching
in interface FixtureExecutionResult
scheduledTime
- The time at which the event should be publishedmatcher
- A matcher defining the event expected to be publishedpublic FixtureExecutionResult expectScheduledEvent(Instant scheduledTime, Object applicationEvent)
FixtureExecutionResult
scheduledTime
.
If the scheduledTime
is calculated based on the "current time", use the FixtureConfiguration.currentTime()
to get the time to use as "current time".
Note that the source attribute of the application event is ignored when comparing events. Events are compared
using an "equals" check on all fields in the events.expectScheduledEvent
in interface FixtureExecutionResult
scheduledTime
- The time at which the event should be publishedapplicationEvent
- The expected eventpublic FixtureExecutionResult expectScheduledEventOfType(Instant scheduledTime, Class<?> eventType)
FixtureExecutionResult
eventType
has been scheduled for publication at the given
scheduledTime
.
If the scheduledTime
is calculated based on the "current time", use the FixtureConfiguration.currentTime()
to get the time to use as "current time".expectScheduledEventOfType
in interface FixtureExecutionResult
scheduledTime
- The time at which the event should be publishedeventType
- The type of the expected eventpublic FixtureExecutionResult expectDispatchedCommands(Object... expected)
FixtureExecutionResult
FixtureExecutionResult.expectDispatchedCommandsMatching(Matcher)
instead.expectDispatchedCommands
in interface FixtureExecutionResult
expected
- The expected commandspublic FixtureExecutionResult expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends List<? super CommandMessage<?>>> matcher)
FixtureExecutionResult
matcher
. Only commands as a
result of the event in the "when" stage of the fixture are matched.expectDispatchedCommandsMatching
in interface FixtureExecutionResult
matcher
- The matcher that describes the expected list of commandspublic FixtureExecutionResult expectNoDispatchedCommands()
FixtureExecutionResult
expectNoDispatchedCommands
in interface FixtureExecutionResult
public FixtureExecutionResult expectNoScheduledEvents()
FixtureExecutionResult
expectNoScheduledEvents
in interface FixtureExecutionResult
public FixtureExecutionResult expectPublishedEventsMatching(org.hamcrest.Matcher<? extends List<? super EventMessage<?>>> matcher)
FixtureExecutionResult
matcher
. Only events
published in the "when" stage of the tests are matched.expectPublishedEventsMatching
in interface FixtureExecutionResult
matcher
- The matcher that defines the expected list of published events.public FixtureExecutionResult expectPublishedEvents(Object... expected)
FixtureExecutionResult
expected
events. Events are compared comparing their type and fields using equals. Sequence number, aggregate identifier
(for domain events) and source (for application events) are ignored in the comparison.expectPublishedEvents
in interface FixtureExecutionResult
expected
- The sequence of events expected to be published by the SagaCopyright © 2010–2017. All rights reserved.