Class EventSourcedBehaviorTestKit$
java.lang.Object
org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit$
Testing of
pekko.persistence.typed.javadsl.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 Summary
FieldsModifier and TypeFieldDescriptionstatic final EventSourcedBehaviorTestKit$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.typesafe.config.Configconfig()The configuration to be included in the configuration of theActorSystem.<Command,Event, State>
EventSourcedBehaviorTestKit<Command,Event, State> create(ActorSystem<?> system, Behavior<Command> behavior) Factory method to create a new EventSourcedBehaviorTestKit.<Command,Event, State>
EventSourcedBehaviorTestKit<Command,Event, State> create(ActorSystem<?> system, Behavior<Command> behavior, EventSourcedBehaviorTestKit.SerializationSettings serializationSettings) Factory method to create a new EventSourcedBehaviorTestKit with customSerializationSettings.
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
EventSourcedBehaviorTestKit$
public EventSourcedBehaviorTestKit$()
-
-
Method Details
-
config
public com.typesafe.config.Config config()The configuration to be included in the configuration of theActorSystem. Typically used as constructor parameter toTestKitJunitResource. The configuration enables the in-memory journal and snapshot storage. -
enabledSerializationSettings
-
disabledSerializationSettings
-
create
public <Command,Event, EventSourcedBehaviorTestKit<Command,State> Event, createState> (ActorSystem<?> system, Behavior<Command> behavior) Factory method to create a new EventSourcedBehaviorTestKit. -
create
public <Command,Event, EventSourcedBehaviorTestKit<Command,State> Event, createState> (ActorSystem<?> system, Behavior<Command> behavior, EventSourcedBehaviorTestKit.SerializationSettings serializationSettings) Factory method to create a new EventSourcedBehaviorTestKit with customSerializationSettings.Note that
equalsmust be implemented in the commands, events and state ifverifyEqualityis enabled.
-