Interface EventSourcedBehaviorTestKit<Command,Event,State>
-
- All Known Implementing Classes:
EventSourcedBehaviorTestKitImpl
public interface EventSourcedBehaviorTestKit<Command,Event,State>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
EventSourcedBehaviorTestKit.CommandResult<Command,Event,State>
The result of running a command.static interface
EventSourcedBehaviorTestKit.CommandResultWithReply<Command,Event,State,Reply>
The result of running a command with areplyTo: ActorRef[R]
, i.e.static interface
EventSourcedBehaviorTestKit.RestartResult<State>
The result of restarting the behavior.static class
EventSourcedBehaviorTestKit.SerializationSettings
Customization of which serialization checks that are performed.static class
EventSourcedBehaviorTestKit.SerializationSettings$
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clears the in-memory journal and snapshot storage and restarts the behavior.State
getState()
Retrieve the current state of the Behavior.PersistenceTestKit
persistenceTestKit()
The underlyingPersistenceTestKit
for the in-memory journal and snapshot storage.EventSourcedBehaviorTestKit.RestartResult<State>
restart()
Restart the behavior, which will then recover from stored snapshot and events.EventSourcedBehaviorTestKit.CommandResult<Command,Event,State>
runCommand(Command command)
Run one command through the behavior.<R> EventSourcedBehaviorTestKit.CommandResultWithReply<Command,Event,State,R>
runCommand(scala.Function1<ActorRef<R>,Command> creator)
Run one command with areplyTo: ActorRef[R]
through the behavior.
-
-
-
Method Detail
-
runCommand
EventSourcedBehaviorTestKit.CommandResult<Command,Event,State> runCommand(Command command)
Run one command through the behavior. The returned result contains emitted events and the state after applying the events.
-
runCommand
<R> EventSourcedBehaviorTestKit.CommandResultWithReply<Command,Event,State,R> runCommand(scala.Function1<ActorRef<R>,Command> creator)
Run one command with areplyTo: ActorRef[R]
through the behavior. The returned result contains emitted events, the state after applying the events, and the reply.
-
getState
State getState()
Retrieve the current state of the Behavior.
-
restart
EventSourcedBehaviorTestKit.RestartResult<State> restart()
Restart the behavior, which will then recover from stored snapshot and events. Can be used for testing that the recovery is correct.
-
clear
void clear()
Clears the in-memory journal and snapshot storage and restarts the behavior.
-
persistenceTestKit
PersistenceTestKit persistenceTestKit()
The underlyingPersistenceTestKit
for the in-memory journal and snapshot storage. Can be useful for advanced testing scenarios, such as simulating failures or populating the journal with events that are used for replay.
-
-