akka.persistence.testkit.scaladsl
EventSourcedBehaviorTestKit
Companion object EventSourcedBehaviorTestKit
trait EventSourcedBehaviorTestKit[Command, Event, State] extends AnyRef
- Annotations
- @ApiMayChange() @DoNotInherit()
- Source
- EventSourcedBehaviorTestKit.scala
- Alphabetic
- By Inheritance
- EventSourcedBehaviorTestKit
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def clear(): Unit
Clears the in-memory journal and snapshot storage and restarts the behavior.
- abstract def getState(): State
Retrieve the current state of the Behavior.
- abstract def initialize(events: Event*): Unit
- abstract def initialize(state: State, events: Event*): Unit
Initializes behavior from provided state and/or events.
- abstract def persistenceTestKit: PersistenceTestKit
The underlying
PersistenceTestKit
for the in-memory journal.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. - abstract def restart(): RestartResult[State]
Restart the behavior, which will then recover from stored snapshot and events.
Restart the behavior, which will then recover from stored snapshot and events. Can be used for testing that the recovery is correct.
- abstract def runCommand[R](creator: (ActorRef[R]) => Command): CommandResultWithReply[Command, Event, State, R]
Run one command with a
replyTo: ActorRef[R]
through the behavior.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. - abstract def runCommand(command: Command): CommandResult[Command, Event, State]
Run one command through the behavior.
Run one command through the behavior. The returned result contains emitted events and the state after applying the events.
- abstract def snapshotTestKit: [SnapshotTestKit]
The underlying
SnapshotTestKit
for snapshot storage.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.