Package akka.persistence.testkit.javadsl
Class EventSourcedBehaviorTestKit.CommandResult<Command,Event,State>
- java.lang.Object
 - 
- akka.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 Summary
Constructors Constructor Description CommandResult(EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> delegate) 
- 
Method Summary
All 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
- 
CommandResult
public CommandResult(EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> delegate)
 
 - 
 
- 
Method Detail
- 
command
public Command command()
The command that was run. 
- 
event
public Event event()
The first event. It will throwAssertionErrorif there is no event. 
- 
eventOfType
public <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. 
- 
events
public 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. 
- 
hasNoEvents
public boolean hasNoEvents()
trueif no events were emitted by the command. 
- 
state
public State state()
The state after applying the events. 
- 
stateOfType
public <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. 
 - 
 
 -