Package akka.persistence.testkit.javadsl
Class EventSourcedBehaviorTestKit$
- java.lang.Object
-
- akka.persistence.testkit.javadsl.EventSourcedBehaviorTestKit$
-
public class EventSourcedBehaviorTestKit$ extends java.lang.Object
Testing ofEventSourcedBehavior
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
Fields Modifier and Type Field Description static EventSourcedBehaviorTestKit$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description EventSourcedBehaviorTestKit$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.typesafe.config.Config
config()
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
.EventSourcedBehaviorTestKit.SerializationSettings
disabledSerializationSettings()
EventSourcedBehaviorTestKit.SerializationSettings
enabledSerializationSettings()
-
-
-
Field Detail
-
MODULE$
public static final EventSourcedBehaviorTestKit$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
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
public EventSourcedBehaviorTestKit.SerializationSettings enabledSerializationSettings()
-
disabledSerializationSettings
public EventSourcedBehaviorTestKit.SerializationSettings disabledSerializationSettings()
-
create
public <Command,Event,State> EventSourcedBehaviorTestKit<Command,Event,State> create(ActorSystem<?> system, Behavior<Command> behavior)
Factory method to create a new EventSourcedBehaviorTestKit.
-
create
public <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
.Note that
equals
must be implemented in the commands, events and state ifverifyEquality
is enabled.
-
-