Package org.axonframework.test.saga
Interface ContinuedGivenState
- All Superinterfaces:
WhenState
- All Known Implementing Classes:
SagaTestFixture
Interface describing methods that can be executed after the first "given" state has been supplied. Either more
"given" state can be appended, or a transition to the definition of "when" can be made.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionandThenAggregate(String aggregateIdentifier) Use this method to indicate that an aggregate with given identifier published certain events.andThenAPublished(Object event) Indicates that the giveneventhas been published in the past.andThenAPublished(Object event, Map<String, ?> metaData) Indicates that the giveneventwith givenmetaDatahas been published in the past.andThenTimeAdvancesTo(Instant newDateTime) Simulate time shifts in the current given state.andThenTimeElapses(Duration elapsedTime) Simulate time shifts in the current given state.Methods inherited from interface org.axonframework.test.saga.WhenState
whenAggregate, whenPublishingA, whenPublishingA, whenTimeAdvancesTo, whenTimeElapses
-
Method Details
-
andThenAggregate
Use this method to indicate that an aggregate with given identifier published certain events. Can be chained to build natural sentences:
andThenAggregate(someIdentifier).published(someEvents)- Parameters:
aggregateIdentifier- The identifier of the aggregate the events should appear to come from- Returns:
- an object that allows registration of the actual events to send
-
andThenTimeElapses
Simulate time shifts in the current given state. This can be useful when the time between given events is of importance.- Parameters:
elapsedTime- The amount of time that will elapse- Returns:
- an object that allows registration of the actual events to send
- Throws:
Exception- if an exception happens when the duration elapses
-
andThenTimeAdvancesTo
Simulate time shifts in the current given state. This can be useful when the time between given events is of importance.- Parameters:
newDateTime- The time to advance the clock to- Returns:
- an object that allows registration of the actual events to send
- Throws:
Exception- if an exception happens when the time advances
-
andThenAPublished
Indicates that the giveneventhas been published in the past. This event is sent to the associated sagas.- Parameters:
event- The event to publish- Returns:
- an object that allows chaining of more given state
- Throws:
Exception- if an exception happens when the event is handled
-
andThenAPublished
Indicates that the giveneventwith givenmetaDatahas been published in the past. This event is sent to the associated sagas.- Parameters:
event- The event to publishmetaData- The meta data to attach to the event- Returns:
- an object that allows chaining of more given state
- Throws:
Exception- if an exception happens when the event is handled
-