Class EventSourcedBehaviorTestKit$

java.lang.Object
org.apache.pekko.persistence.testkit.scaladsl.EventSourcedBehaviorTestKit$

public class EventSourcedBehaviorTestKit$ extends Object
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.

  • Field Details

  • Constructor Details

    • EventSourcedBehaviorTestKit$

      public EventSourcedBehaviorTestKit$()
  • Method Details

    • config

      public com.typesafe.config.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.
    • apply

      public <Command, Event, State> EventSourcedBehaviorTestKit<Command,Event,State> apply(ActorSystem<?> system, Behavior<Command> behavior)
      Factory method to create a new EventSourcedBehaviorTestKit.
    • apply

      public <Command, Event, State> EventSourcedBehaviorTestKit<Command,Event,State> apply(ActorSystem<?> system, Behavior<Command> behavior, EventSourcedBehaviorTestKit.SerializationSettings 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.