com.lightbend.lagom.scaladsl.testkit
PersistentEntityTestDriver
Companion object PersistentEntityTestDriver
class PersistentEntityTestDriver[C, E, S] extends AnyRef
A testing utility for verifying that a com.lightbend.lagom.scaladsl.persistence.PersistentEntity emits expected events and side-effects in response to incoming commands.
It also verifies that all commands, events, replies and state are
serializable, and reports any such problems in the issues
of the Outcome
.
- Alphabetic
- By Inheritance
- PersistentEntityTestDriver
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new PersistentEntityTestDriver(system: ActorSystem, entity: PersistentEntity { ... /* 3 definitions in type refinement */ }, entityId: String)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to any2stringadd[PersistentEntityTestDriver[C, E, S]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (PersistentEntityTestDriver[C, E, S], B)
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to ArrowAssoc[PersistentEntityTestDriver[C, E, S]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
ensuring(cond: (PersistentEntityTestDriver[C, E, S]) ⇒ Boolean, msg: ⇒ Any): PersistentEntityTestDriver[C, E, S]
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to Ensuring[PersistentEntityTestDriver[C, E, S]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (PersistentEntityTestDriver[C, E, S]) ⇒ Boolean): PersistentEntityTestDriver[C, E, S]
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to Ensuring[PersistentEntityTestDriver[C, E, S]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): PersistentEntityTestDriver[C, E, S]
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to Ensuring[PersistentEntityTestDriver[C, E, S]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): PersistentEntityTestDriver[C, E, S]
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to Ensuring[PersistentEntityTestDriver[C, E, S]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- val entity: PersistentEntity { ... /* 3 definitions in type refinement */ }
- val entityId: String
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to StringFormat[PersistentEntityTestDriver[C, E, S]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
def
getAllIssues: Seq[Issue]
Accumulated issues from all previous runs.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initialize(snapshotState: Option[S], events: E*): Outcome[E, S]
Initialize the entity.
Initialize the entity.
This can be used to simulate the startup of an entity, be passing some snapshot state, and then some additional events that weren't included in that entity.
The returned outcome contains the state with events applied to it and any issues with the state and events.
This method may not be invoked twice, and it also must not be invoked after passing commands to the
run
method, since that will automatically initialize the entity with an empty snapshot if not yet initialized.- snapshotState
The state to initialize the entity with.
- events
The additional events to run before invoking
recoveryCompleted
- returns
The outcome.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
run(commands: C*): Outcome[E, S]
The entity will process the commands and the emitted events and side effects are recorded and provided in the returned
Outcome
.The entity will process the commands and the emitted events and side effects are recorded and provided in the returned
Outcome
. Current state is also included in theOutcome
.run
may be invoked multiple times to divide the sequence of commands into manageable steps. TheOutcome
contains the events and side-effects of the lastrun
, but the state is not reset between different runs. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val system: ActorSystem
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
→[B](y: B): (PersistentEntityTestDriver[C, E, S], B)
- Implicit
- This member is added by an implicit conversion from PersistentEntityTestDriver[C, E, S] to ArrowAssoc[PersistentEntityTestDriver[C, E, S]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc