Class DurableStateBehaviorTestKit$
java.lang.Object
org.apache.pekko.persistence.testkit.scaladsl.DurableStateBehaviorTestKit$
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final DurableStateBehaviorTestKit$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<Command,State>
DurableStateBehaviorTestKit<Command,State> apply(ActorSystem<?> system, Behavior<Command> behavior) Factory method to create a new DurableStateBehaviorTestKit.<Command,State>
DurableStateBehaviorTestKit<Command,State> apply(ActorSystem<?> system, Behavior<Command> behavior, DurableStateBehaviorTestKit.SerializationSettings serializationSettings) Factory method to create a new DurableStateBehaviorTestKit with customSerializationSettings.com.typesafe.config.Configconfig()The configuration to be included in the configuration of theActorSystem.
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
DurableStateBehaviorTestKit$
public DurableStateBehaviorTestKit$()
-
-
Method Details
-
config
public com.typesafe.config.Config config()The configuration to be included in the configuration of theActorSystem. Typically used as constructor parameter toScalaTestWithActorTestKit. 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 customSerializationSettings.Note that
equalsmust be implemented (or usingcase class) in the commands and state ifverifyEqualityis enabled.
-