Class PersistenceProbeBehavior<Command,Event,State>
java.lang.Object
org.apache.pekko.persistence.testkit.javadsl.PersistenceProbeBehavior<Command,Event,State>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <Command,State>
PersistenceProbeBehavior<Command,Void, State> fromDurableState(Behavior<Command> behavior) static <Command,State>
PersistenceProbeBehavior<Command,Void, State> fromDurableState(Behavior<Command> behavior, State initialState) static <Command,Event, State>
PersistenceProbeBehavior<Command,Event, State> fromEventSourced(Behavior<Command> behavior) static <Command,Event, State>
PersistenceProbeBehavior<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.Note: durable state behaviors will not publish events to this probe
-
Constructor Details
-
PersistenceProbeBehavior
public PersistenceProbeBehavior()
-
-
Method Details
-
fromEventSourced
public static <Command,Event, PersistenceProbeBehavior<Command,State> Event, fromEventSourcedState> (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 persistenceProbe behaviorinitialState- start the persistenceProbe behavior with this state; if null, behavior's initialState will be usedinitialSequenceNr- start the persistenceProbe behavior with this sequence number; only applies if initialState is non-null- Returns:
- an PersistenceProbeBehavior based on an EventSourcedBehavior
-
fromEventSourced
public static <Command,Event, PersistenceProbeBehavior<Command,State> Event, fromEventSourcedState> (Behavior<Command> behavior) -
fromDurableState
public static <Command,State> PersistenceProbeBehavior<Command,Void, fromDurableStateState> (Behavior<Command> behavior, State initialState) -
fromDurableState
public static <Command,State> PersistenceProbeBehavior<Command,Void, fromDurableStateState> (Behavior<Command> behavior) -
getBehavior
-
getBehaviorTestKit
-
getEventProbe
Note: durable state behaviors will not publish events to this probe -
getStateProbe
-
getSnapshotProbe
-