Class EventSourcedBehaviorTestKit.CommandResult<Command,Event,State>
java.lang.Object
org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit.CommandResult<Command,Event,State>
- Direct Known Subclasses:
EventSourcedBehaviorTestKit.CommandResultWithReply
- Enclosing class:
- EventSourcedBehaviorTestKit<Command,
Event, State>
The result of running a command.
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncommand()The command that was run.event()The first event.<E extends Event>
EeventOfType(Class<E> eventClass) The first event as a given expected type.events()The events that were emitted by the command, and persisted.booleantrueif no events were emitted by the command.state()The state after applying the events.<S extends State>
SstateOfType(Class<S> stateClass) The state as a given expected type.
-
Constructor Details
-
CommandResult
-
-
Method Details
-
command
The command that was run. -
event
The first event. It will throwAssertionErrorif there is no event. -
eventOfType
The first event as a given expected type. It will throwAssertionErrorif there is no event or if the event is of a different type. -
events
The events that were emitted by the command, and persisted. In many cases only one event is emitted and then it's more convenient to useCommandResult.eventorCommandResult.eventOfType. -
hasNoEvents
public boolean hasNoEvents()trueif no events were emitted by the command. -
state
The state after applying the events. -
stateOfType
The state as a given expected type. It will throwAssertionErrorif the state is of a different type.
-