EventSourcedBehaviorTestKit

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

Testing of pekko.persistence.typed.scaladsl.EventSourcedBehavior implementations. It supports running one command at a time and you can assert that the synchronously returned result is as expected. The result contains the events emitted by the command and the new state after applying the events. It also has support for verifying the reply to a command.

Serialization of commands, events and state are verified automatically.

Attributes

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

Members list

Type members

Classlikes

trait CommandResult[Command, Event, State]

The result of running a command.

The result of running a command.

Attributes

Source
EventSourcedBehaviorTestKit.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait CommandResultWithReply[Command, Event, State, Reply]
trait CommandResultWithReply[Command, Event, State, Reply] extends CommandResult[Command, Event, State]

The result of running a command with a replyTo: ActorRef[R], i.e. the runCommand with a ActorRef[R] => Command parameter.

The result of running a command with a replyTo: ActorRef[R], i.e. the runCommand with a ActorRef[R] => Command parameter.

Attributes

Source
EventSourcedBehaviorTestKit.scala
Supertypes
trait CommandResult[Command, Event, State]
class Object
trait Matchable
class Any

The result of restarting the behavior.

The result of restarting the behavior.

Attributes

Source
EventSourcedBehaviorTestKit.scala
Supertypes
class Object
trait Matchable
class Any
final class SerializationSettings

Customization of which serialization checks that are performed. equals must be implemented (or using case class) when verifyEquality is enabled.

Customization of which serialization checks that are performed. equals must be implemented (or using case class) when verifyEquality is enabled.

Attributes

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

Attributes

Companion
class
Source
EventSourcedBehaviorTestKit.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def apply[Command, Event, State](system: ActorSystem[_], behavior: Behavior[Command]): EventSourcedBehaviorTestKit[Command, Event, State]

Factory method to create a new EventSourcedBehaviorTestKit.

Factory method to create a new EventSourcedBehaviorTestKit.

Attributes

Source
EventSourcedBehaviorTestKit.scala
def apply[Command, Event, State](system: ActorSystem[_], behavior: Behavior[Command], serializationSettings: SerializationSettings): EventSourcedBehaviorTestKit[Command, Event, State]

Factory method to create a new EventSourcedBehaviorTestKit with custom SerializationSettings.

Factory method to create a new EventSourcedBehaviorTestKit with custom SerializationSettings.

Note that equals must be implemented (or using case class) in the commands, events and state if verifyEquality is enabled.

Attributes

Source
EventSourcedBehaviorTestKit.scala

Concrete fields

val config: Config

The configuration to be included in the configuration of the ActorSystem. Typically used as constructor parameter to ScalaTestWithActorTestKit. The configuration enables the in-memory journal and snapshot storage.

The configuration to be included in the configuration of the ActorSystem. Typically used as constructor parameter to ScalaTestWithActorTestKit. The configuration enables the in-memory journal and snapshot storage.

Attributes

Source
EventSourcedBehaviorTestKit.scala