Package org.axonframework.test.saga
Interface WhenAggregateEventPublisher
public interface WhenAggregateEventPublisher
Interface to an object that publishes events on behalf of an aggregate, recording what the Saga does in reaction.
Axon Framework 5 has no DomainEventMessage, so the aggregate type, aggregate identifier and sequence number
travel on the processing context rather than on the message. A Saga reads them as
AggregateType,
SourceId and
SequenceNumber handler parameters, which
is where Axon Framework 4 read them from the message. A handler declaring one of those is only invoked for an event
that has an aggregate, so an event published through FixtureConfiguration.givenAPublished(Object) does not
reach it.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionRegister the giveneventto be published on behalf of an aggregate.Register the giveneventto be published on behalf of an aggregate, with given additionalmetadata.
-
Method Details
-
publishes
Register the giveneventto be published on behalf of an aggregate. Activity caused by this event on the command bus and event sink is monitored and can be checked in theFixtureExecutionResult.- Parameters:
event- The event published by the aggregate- Returns:
- a reference to the test results for the validation phase
-
publishes
Register the giveneventto be published on behalf of an aggregate, with given additionalmetadata. Activity caused by this event on the command bus and event sink is monitored and can be checked in theFixtureExecutionResult.- Parameters:
event- The event published by the aggregatemetadata- The metadata to attach to the event- Returns:
- a reference to the test results for the validation phase
-