|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FixtureExecutionResult
Interface towards an object that contains the results of a Fixture execution. It provides methods to assert that certain actions have taken place.
Method Summary | |
---|---|
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 |
expectDispatchedCommandsEqualTo(Object... commands)
Asserts that the given commands have been dispatched in exactly the order given. |
FixtureExecutionResult |
expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends Iterable<?>> 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 Iterable<?>> matcher)
Assert that the saga published events on the EventBus as defined by the given matcher . |
FixtureExecutionResult |
expectScheduledEvent(org.joda.time.DateTime scheduledTime,
Object event)
Asserts that an event equal to the given ApplicationEvent has been scheduled for publication at the given scheduledTime . |
FixtureExecutionResult |
expectScheduledEvent(org.joda.time.Duration duration,
Object event)
Asserts that an event equal to the given ApplicationEvent has been scheduled for publication after the given duration . |
FixtureExecutionResult |
expectScheduledEventMatching(org.joda.time.DateTime scheduledTime,
org.hamcrest.Matcher<?> matcher)
Asserts that an event matching the given matcher has been scheduled to be published at the given
scheduledTime . |
FixtureExecutionResult |
expectScheduledEventMatching(org.joda.time.Duration duration,
org.hamcrest.Matcher<?> matcher)
Asserts that an event matching the given matcher has been scheduled to be published after the given
duration . |
FixtureExecutionResult |
expectScheduledEventOfType(org.joda.time.DateTime scheduledTime,
Class<?> eventType)
Asserts that an event of the given eventType has been scheduled for publication at the given
scheduledTime . |
FixtureExecutionResult |
expectScheduledEventOfType(org.joda.time.Duration duration,
Class<?> eventType)
Asserts that an event of the given eventType has been scheduled for publication after the given
duration . |
Method Detail |
---|
FixtureExecutionResult expectActiveSagas(int expected)
expected
- the expected number of active events in the repository
FixtureExecutionResult expectAssociationWith(String associationKey, Object associationValue)
associationKey
and
associationValue
.
associationKey
- The key of the association to verifyassociationValue
- The value of the association to verify
FixtureExecutionResult expectNoAssociationWith(String associationKey, Object associationValue)
associationKey
and
associationValue
.
associationKey
- The key of the association to verifyassociationValue
- The value of the association to verify
FixtureExecutionResult expectScheduledEventMatching(org.joda.time.Duration duration, org.hamcrest.Matcher<?> matcher)
matcher
has been scheduled to be published after the given
duration
.
duration
- The time to wait before the event should be publishedmatcher
- A matcher defining the event expected to be published
FixtureExecutionResult expectScheduledEvent(org.joda.time.Duration duration, Object event)
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.
duration
- The time to wait before the event should be publishedevent
- The expected event
FixtureExecutionResult expectScheduledEventOfType(org.joda.time.Duration duration, Class<?> eventType)
eventType
has been scheduled for publication after the given
duration
.
duration
- The time to wait before the event should be publishedeventType
- The type of the expected event
FixtureExecutionResult expectScheduledEventMatching(org.joda.time.DateTime scheduledTime, org.hamcrest.Matcher<?> matcher)
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".
scheduledTime
- The time at which the event should be publishedmatcher
- A matcher defining the event expected to be published
FixtureExecutionResult expectScheduledEvent(org.joda.time.DateTime scheduledTime, Object event)
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.
scheduledTime
- The time at which the event should be publishedevent
- The expected event
FixtureExecutionResult expectScheduledEventOfType(org.joda.time.DateTime scheduledTime, Class<?> eventType)
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".
scheduledTime
- The time at which the event should be publishedeventType
- The type of the expected event
FixtureExecutionResult expectDispatchedCommandsEqualTo(Object... commands)
commands
- The expected commands
FixtureExecutionResult expectDispatchedCommandsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
matcher
. Only commands as a
result of the event in the "when" stage of the fixture are matched.
matcher
- The matcher that describes the expected list of commands
FixtureExecutionResult expectNoDispatchedCommands()
FixtureExecutionResult expectNoScheduledEvents()
FixtureExecutionResult expectPublishedEventsMatching(org.hamcrest.Matcher<? extends Iterable<?>> matcher)
matcher
. Only events
published in the "when" stage of the tests are matched.
matcher
- The matcher that defines the expected list of published events.
FixtureExecutionResult expectPublishedEvents(Object... expected)
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.
expected
- The sequence of events expected to be published by the Saga
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |