public interface WhenState
| Modifier and Type | Method and Description |
|---|---|
WhenAggregateEventPublisher |
whenAggregate(String 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 |
whenPublishingA(Object event,
Map<String,?> metaData)
Use this method to indicate an application is published with given additional
metaData,
while recording the outcome. |
FixtureExecutionResult |
whenTimeAdvancesTo(Instant newDateTime)
Mimic an elapsed time with no relevant activity for the Saga.
|
FixtureExecutionResult |
whenTimeElapses(Duration elapsedTime)
Mimic an elapsed time with no relevant activity for the Saga.
|
WhenAggregateEventPublisher whenAggregate(String aggregateIdentifier)
FixtureConfiguration.givenAggregate(String) given} and
ContinuedGivenState.andThenAggregate(String) 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 fromFixtureExecutionResult 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 publishFixtureExecutionResult whenPublishingA(Object event, Map<String,?> metaData)
metaData,
while recording the outcome.
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.event - the event to publishmetaData - The meta data to attach to the eventFixtureExecutionResult whenTimeElapses(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 elapseFixtureExecutionResult whenTimeAdvancesTo(Instant 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 toCopyright © 2010–2025. All rights reserved.