EventSourcedBehaviorTestKit

org.apache.pekko.persistence.testkit.scaladsl.EventSourcedBehaviorTestKit
See theEventSourcedBehaviorTestKit companion object

Attributes

Companion
object
Source
EventSourcedBehaviorTestKit.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def clear(): Unit

Clears the in-memory journal and snapshot storage and restarts the behavior.

Clears the in-memory journal and snapshot storage and restarts the behavior.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def getState(): State

Retrieve the current state of the Behavior.

Retrieve the current state of the Behavior.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def initialize(state: State, events: Event*): Unit

Initializes behavior from provided state and/or events.

Initializes behavior from provided state and/or events.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def initialize(events: Event*): Unit

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.

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.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def restart(): RestartResult[State]

Restart the behavior, which will then recover from stored snapshot and events. Can be used for testing that the recovery is correct.

Restart the behavior, which will then recover from stored snapshot and events. Can be used for testing that the recovery is correct.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def runCommand(command: Command): CommandResult[Command, Event, State]

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

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

Attributes

Source
EventSourcedBehaviorTestKit.scala
def runCommand[R](creator: (ActorRef[R]) => Command): CommandResultWithReply[Command, Event, State, R]

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.

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.

Attributes

Source
EventSourcedBehaviorTestKit.scala

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.

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.

Attributes

Source
EventSourcedBehaviorTestKit.scala