Class DurableStateBehaviorTestKit$

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

public class DurableStateBehaviorTestKit$ extends Object
Testing of pekko.persistence.typed.state.scaladsl.DurableStateBehavior implementations. It supports running one command at a time and asserting that the synchronously returned result is as expected. The result contains the new state after the command has been processed. It also has support for verifying the reply to a command.

Serialization of commands and state is verified automatically.

Since:
2.0.0
  • Field Details

  • Constructor Details

    • DurableStateBehaviorTestKit$

      public DurableStateBehaviorTestKit$()
  • 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 durable state store.
    • apply

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

      public <Command, State> DurableStateBehaviorTestKit<Command,State> apply(ActorSystem<?> system, Behavior<Command> behavior, DurableStateBehaviorTestKit.SerializationSettings serializationSettings)
      Factory method to create a new DurableStateBehaviorTestKit with custom SerializationSettings.

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