Interface EventSourcedBehaviorTestKit<Command,Event,State>


public interface EventSourcedBehaviorTestKit<Command,Event,State>
  • Method Details

    • runCommand

      Run one command through the behavior. The returned result contains emitted events and the state after applying the events.
    • runCommand

      Run one command with a replyTo: 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

      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 underlying PersistenceTestKit for the in-memory journal. Can be useful for advanced testing scenarios, such as simulating failures or populating the journal with events that are used for replay.
    • snapshotTestKit

      scala.Option<SnapshotTestKit> snapshotTestKit()
      The underlying SnapshotTestKit for snapshot storage. Present only if snapshots are enabled. Can be useful for advanced testing scenarios, such as simulating failures or populating the storage with snapshots that are used for replay.
    • initialize

      void initialize(State state, scala.collection.immutable.Seq<Event> events)
      Initializes behavior from provided state and/or events.
    • initialize

      void initialize(scala.collection.immutable.Seq<Event> events)