Package akka.persistence.testkit.javadsl
Class UnpersistentBehavior<Command,Event,State>
- java.lang.Object
-
- akka.persistence.testkit.javadsl.UnpersistentBehavior<Command,Event,State>
-
public final class UnpersistentBehavior<Command,Event,State> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description UnpersistentBehavior()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <Command,State>
UnpersistentBehavior<Command,java.lang.Void,State>fromDurableState(Behavior<Command> behavior)
static <Command,State>
UnpersistentBehavior<Command,java.lang.Void,State>fromDurableState(Behavior<Command> behavior, State initialState)
static <Command,Event,State>
UnpersistentBehavior<Command,Event,State>fromEventSourced(Behavior<Command> behavior)
static <Command,Event,State>
UnpersistentBehavior<Command,Event,State>fromEventSourced(Behavior<Command> behavior, State initialState, long initialSequenceNr)
Given an EventSourcedBehavior, produce a non-persistent Behavior which synchronously publishes events and snapshots for inspection.Behavior<Command>
getBehavior()
BehaviorTestKit<Command>
getBehaviorTestKit()
PersistenceProbe<Event>
getEventProbe()
Note: durable state behaviors will not publish events to this probePersistenceProbe<State>
getSnapshotProbe()
PersistenceProbe<State>
getStateProbe()
-
-
-
Method Detail
-
fromEventSourced
public static <Command,Event,State> UnpersistentBehavior<Command,Event,State> fromEventSourced(Behavior<Command> behavior, State initialState, long initialSequenceNr)
Given an EventSourcedBehavior, produce a non-persistent Behavior which synchronously publishes events and snapshots for inspection. State is updated as in the EventSourcedBehavior, and side effects are performed synchronously. The resulting Behavior is, contingent on the command handling, event handling, and side effects being compatible with the BehaviorTestKit, testable with the BehaviorTestKit.The returned Behavior does not intrinsically depend on configuration: it therefore does not serialize and assumes an unbounded stash for commands.
- Parameters:
behavior
- a (possibly wrapped) EventSourcedBehavior to serve as the basis for the unpersistent behaviorinitialState
- start the unpersistent behavior with this state; if null, behavior's initialState will be usedinitialSequenceNr
- start the unpersistent behavior with this sequence number; only applies if initialState is non-null- Returns:
- an UnpersistentBehavior based on an EventSourcedBehavior
-
fromEventSourced
public static <Command,Event,State> UnpersistentBehavior<Command,Event,State> fromEventSourced(Behavior<Command> behavior)
-
fromDurableState
public static <Command,State> UnpersistentBehavior<Command,java.lang.Void,State> fromDurableState(Behavior<Command> behavior, State initialState)
-
fromDurableState
public static <Command,State> UnpersistentBehavior<Command,java.lang.Void,State> fromDurableState(Behavior<Command> behavior)
-
getBehaviorTestKit
public BehaviorTestKit<Command> getBehaviorTestKit()
-
getEventProbe
public PersistenceProbe<Event> getEventProbe()
Note: durable state behaviors will not publish events to this probe
-
getStateProbe
public PersistenceProbe<State> getStateProbe()
-
getSnapshotProbe
public PersistenceProbe<State> getSnapshotProbe()
-
-