Interface WhenAggregateEventPublisher


public interface WhenAggregateEventPublisher
Interface to an object that publishes events on behalf of an aggregate. The sequence number on the events must be exactly sequential per aggregate.
Since:
1.1
Author:
Allard Buijze
  • Method Details

    • publishes

      FixtureExecutionResult publishes(Object event)
      Register the given event to be published on behalf of an aggregate. Activity caused by this event on the CommandBus and EventBus is monitored and can be checked in the FixtureExecutionResult.
      Parameters:
      event - The event published by the aggregate
      Returns:
      a reference to the test results for the validation phase
    • publishes

      FixtureExecutionResult publishes(Object event, Map<String,?> metaData)
      Register the given event to be published on behalf of an aggregate, with given additional metaData. Activity caused by this event on the CommandBus and EventBus is monitored and can be checked in the FixtureExecutionResult.
      Parameters:
      event - The event published by the aggregate
      metaData - The meta data to attach to the event
      Returns:
      a reference to the test results for the validation phase