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>
 
 public static class EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> extends java.lang.ObjectThe result of running a command.
- 
- 
Constructor SummaryConstructors Constructor Description CommandResult(EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> delegate)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Commandcommand()The command that was run.Eventevent()The first event.<E extends Event>
 EeventOfType(java.lang.Class<E> eventClass)The first event as a given expected type.java.util.List<Event>events()The events that were emitted by the command, and persisted.booleanhasNoEvents()trueif no events were emitted by the command.Statestate()The state after applying the events.<S extends State>
 SstateOfType(java.lang.Class<S> stateClass)The state as a given expected type.
 
- 
- 
- 
Constructor Detail- 
CommandResultpublic CommandResult(EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> delegate) 
 
- 
 - 
Method Detail- 
commandpublic Command command() The command that was run.
 - 
eventpublic Event event() The first event. It will throwAssertionErrorif there is no event.
 - 
eventOfTypepublic <E extends Event> E eventOfType(java.lang.Class<E> eventClass) The first event as a given expected type. It will throwAssertionErrorif there is no event or if the event is of a different type.
 - 
eventspublic java.util.List<Event> 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.
 - 
hasNoEventspublic boolean hasNoEvents() trueif no events were emitted by the command.
 - 
statepublic State state() The state after applying the events.
 - 
stateOfTypepublic <S extends State> S stateOfType(java.lang.Class<S> stateClass) The state as a given expected type. It will throwAssertionErrorif the state is of a different type.
 
- 
 
-