akka.persistence.testkit.javadsl
EventSourcedBehaviorTestKit
Companion object EventSourcedBehaviorTestKit
final class EventSourcedBehaviorTestKit[Command, Event, State] extends AnyRef
- Annotations
- @ApiMayChange()
- Source
- EventSourcedBehaviorTestKit.scala
- Alphabetic
- By Inheritance
- EventSourcedBehaviorTestKit
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new EventSourcedBehaviorTestKit(delegate: scaladsl.EventSourcedBehaviorTestKit[Command, Event, State])
Value Members
- def clear(): Unit
Clears the in-memory journal and snapshot storage and restarts the behavior.
- def getState(): State
Retrieve the current state of the Behavior.
- def initialize(events: Event*): Unit
- Annotations
- @varargs()
- def initialize(state: State, events: Event*): Unit
Initializes behavior from provided state and/or events.
Initializes behavior from provided state and/or events.
- Annotations
- @varargs()
- 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. - 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.
- def runCommand[R](creator: [ActorRef[R], Command]): CommandResultWithReply[Command, Event, State, R]
Run one command with a
replyTo: ActorRef
through the behavior.Run one command with a
replyTo: ActorRef
through the behavior. The returned result contains emitted events, the state after applying the events, and the reply. - 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.
- 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.