Interface EventSourcedResult<R>
-
- Type Parameters:
R- The type of reply that is expected from invoking a command handler
public interface EventSourcedResult<R>Represents the result of an EventSourcedEntity handling a command when run in through the testkit.Not for user extension, returned by the generated testkit.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandidEmitEvents()java.util.List<java.lang.Object>getAllEvents()java.lang.StringgetError()The error description.DeferredCallDetails<?,R>getForward()An object with details about the forward.<E> EgetNextEventOfType(java.lang.Class<E> expectedClass)Look at the next event and verify that it is of type E or fail if not or if there is no next event.RgetReply()The reply object from the handler if there was one.java.util.List<DeferredCallDetails<?,?>>getSideEffects()java.lang.ObjectgetUpdatedState()booleanisError()booleanisForward()booleanisNoReply()booleanisReply()
-
-
-
Method Detail
-
isReply
boolean isReply()
- Returns:
- true if the call had an effect with a reply, false if not
-
getReply
R getReply()
The reply object from the handler if there was one. If the call had an effect without any reply an exception is thrown
-
isForward
boolean isForward()
- Returns:
- true if the call was forwarded, false if not
-
getForward
DeferredCallDetails<?,R> getForward()
An object with details about the forward. If the result was not a forward an exception is thrown
-
isError
boolean isError()
- Returns:
- true if the call was an error, false if not
-
getError
java.lang.String getError()
The error description. If the result was not an error an exception is thrown
-
isNoReply
boolean isNoReply()
- Returns:
- true if the call had a noReply effect, false if not
-
getUpdatedState
java.lang.Object getUpdatedState()
- Returns:
- The updated state. If the state was not updated (no events emitted) an exeption is thrown
-
didEmitEvents
boolean didEmitEvents()
-
getAllEvents
java.util.List<java.lang.Object> getAllEvents()
- Returns:
- All the events that were emitted by handling this command.
-
getNextEventOfType
<E> E getNextEventOfType(java.lang.Class<E> expectedClass)
Look at the next event and verify that it is of type E or fail if not or if there is no next event. If successful this consumes the event, so that the next call to this method looks at the next event from here.- Returns:
- The next event if it is of type E, for additional assertions.
-
getSideEffects
java.util.List<DeferredCallDetails<?,?>> getSideEffects()
- Returns:
- The list of side effects
-
-