|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WhenState
Interface providing an API to methods in the "when" state of the fixture execution. Unlike the methods in the "given" state, these methods record the behavior of the Sagas involved for validation.
Method Summary | |
---|---|
WhenAggregateEventPublisher |
whenAggregate(Object aggregateIdentifier)
Use this method to indicate that an aggregate with given identifier should publish certain events, while recording the outcome. |
FixtureExecutionResult |
whenPublishingA(Object event)
Use this method to indicate an application is published, while recording the outcome. |
FixtureExecutionResult |
whenTimeAdvancesTo(org.joda.time.DateTime newDateTime)
Mimic an elapsed time with no relevant activity for the Saga. |
FixtureExecutionResult |
whenTimeElapses(org.joda.time.Duration elapsedTime)
Mimic an elapsed time with no relevant activity for the Saga. |
Method Detail |
---|
WhenAggregateEventPublisher whenAggregate(Object aggregateIdentifier)
FixtureConfiguration.givenAggregate(Object)
given} and
ContinuedGivenState.andThenAggregate(Object)
andThen} methods, this method
will start recording activity on the EventBus and CommandBus.
Can be chained to build natural sentences:whenAggregate(someIdentifier).publishes(anEvent)
Note that if you inject resources using FixtureConfiguration.registerResource(Object)
, you may need to
reset them yourself if they are manipulated by the Saga in the "given" stage of the test.
aggregateIdentifier
- The identifier of the aggregate the events should appear to come from
FixtureExecutionResult whenPublishingA(Object event)
FixtureConfiguration.registerResource(Object)
, you may need to
reset them yourself if they are manipulated by the Saga in the "given" stage of the test.
event
- the event to publish
FixtureExecutionResult whenTimeElapses(org.joda.time.Duration elapsedTime)
FixtureConfiguration.registerResource(Object)
, you may need to
reset them yourself if they are manipulated by the Saga in the "given" stage of the test.
elapsedTime
- The amount of time to elapse
FixtureExecutionResult whenTimeAdvancesTo(org.joda.time.DateTime newDateTime)
FixtureConfiguration.registerResource(Object)
, you may need to
reset them yourself if they are manipulated by the Saga in the "given" stage of the test.
newDateTime
- The time to advance the clock to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |