class SnapshotTestKit extends CommonTestKitOps[(SnapshotMetadata, Any), SnapshotOperation] with PolicyOpsTestKit[SnapshotOperation] with ExpectOps[(SnapshotMetadata, Any)] with HasStorage[SnapshotOperation, (SnapshotMetadata, Any)]
Class for testing snapshots of persistent actors.
NOTE! ActorSystem must be configured with PersistenceTestKitSnapshotPlugin. The configuration can be retrieved with PersistenceTestKitSnapshotPlugin.config.
- Annotations
- @ApiMayChange()
- Source
- PersistenceTestKit.scala
- Alphabetic
- By Inheritance
- SnapshotTestKit
- HasStorage
- ExpectOps
- CommonTestKitOps
- PolicyOpsTestKit
- ClearOps
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SnapshotTestKit(system: ActorSystem)
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 SnapshotTestKit toany2stringadd[SnapshotTestKit] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (SnapshotTestKit, B)
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toArrowAssoc[SnapshotTestKit] 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 clearAll(): Unit
Clear all data from the storage.
Clear all data from the storage.
NOTE! Also clears sequence numbers in storage!
- Definition Classes
- ClearOps
- See also
ClearPreservingSeqNums.clearAllPreservingSeqNumbers()
- def clearByPersistenceId(persistenceId: String): Unit
Clear all data from the storage for particular persistence id.
Clear all data from the storage for particular persistence id.
NOTE! Also clears sequence number in the storage!
- Definition Classes
- ClearOps
- See also
ClearPreservingSeqNums.clearByIdPreservingSeqNumbers()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def ensuring(cond: (SnapshotTestKit) => Boolean, msg: => Any): SnapshotTestKit
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toEnsuring[SnapshotTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (SnapshotTestKit) => Boolean): SnapshotTestKit
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toEnsuring[SnapshotTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): SnapshotTestKit
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toEnsuring[SnapshotTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): SnapshotTestKit
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toEnsuring[SnapshotTestKit] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def expectNextPersisted[A](persistenceId: String, event: A): A
Check that next persisted in storage for particular persistence id event/snapshot was
event
.Check that next persisted in storage for particular persistence id event/snapshot was
event
.- Definition Classes
- SnapshotTestKit → ExpectOps → CommonTestKitOps
- def expectNextPersisted[A](persistenceId: String, event: A, max: FiniteDuration): A
Check for
max
time that next persisted in storage for particular persistence id event/snapshot wasevent
.Check for
max
time that next persisted in storage for particular persistence id event/snapshot wasevent
.- Definition Classes
- ExpectOps
- def expectNextPersistedClass[A](persistenceId: String, cla: Class[A], max: FiniteDuration): A
Check for
max
time that next persisted in storage for particular persistence id event/snapshot has expected type.Check for
max
time that next persisted in storage for particular persistence id event/snapshot has expected type.- Definition Classes
- ExpectOps
- def expectNextPersistedClass[A](persistenceId: String, cla: Class[A]): A
Check that next persisted in storage for particular persistence id event/snapshot has expected type.
Check that next persisted in storage for particular persistence id event/snapshot has expected type.
- Definition Classes
- ExpectOps
- def expectNextPersistedType[A](persistenceId: String, max: FiniteDuration)(implicit t: ClassTag[A]): A
Check for
max
time that next persisted in storage for particular persistence id event/snapshot has expected type.Check for
max
time that next persisted in storage for particular persistence id event/snapshot has expected type.- Definition Classes
- ExpectOps
- def expectNextPersistedType[A](persistenceId: String)(implicit t: ClassTag[A]): A
Check that next persisted in storage for particular persistence id event/snapshot has expected type.
Check that next persisted in storage for particular persistence id event/snapshot has expected type.
- Definition Classes
- ExpectOps
- def expectNothingPersisted(persistenceId: String, max: FiniteDuration): Unit
Check for
max
time that nothing was persisted in storage for particular persistence id.Check for
max
time that nothing was persisted in storage for particular persistence id.- Definition Classes
- ExpectOps
- def expectNothingPersisted(persistenceId: String): Unit
Check that nothing was persisted in storage for particular persistence id.
Check that nothing was persisted in storage for particular persistence id.
- Definition Classes
- ExpectOps
- def failNextDelete(persistenceId: String): Unit
Fail next delete from storage attempt with default exception for particular persistence id.
Fail next delete from storage attempt with default exception for particular persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextDelete(persistenceId: String, cause: Throwable): Unit
Fail next delete from storage attempt with
cause
exception for particular persistence id.Fail next delete from storage attempt with
cause
exception for particular persistence id.- Definition Classes
- CommonTestKitOps
- def failNextDelete(): Unit
Fail next delete from storage attempt with default exception for any persistence id.
Fail next delete from storage attempt with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextDelete(cause: Throwable): Unit
Fail next delete from storage attempt with
cause
exception for any persistence id.Fail next delete from storage attempt with
cause
exception for any persistence id.- Definition Classes
- CommonTestKitOps
- def failNextNDeletes(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next n delete from storage attempts with
cause
exception for particular persistence id.Fail next n delete from storage attempts with
cause
exception for particular persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNDeletes(n: Int, cause: Throwable): Unit
Fail next n delete from storage attempts with
cause
exception for any persistence id.Fail next n delete from storage attempts with
cause
exception for any persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNDeletes(persistenceId: String, n: Int): Unit
Fail next n delete from storage attempts with default exception for particular persistence id.
Fail next n delete from storage attempts with default exception for particular persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextNDeletes(n: Int): Unit
Fail next n delete from storage attempts with default exception for any persistence id.
Fail next n delete from storage attempts with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextNOps(n: Int, cause: Throwable): Unit
Fail
n
following journal operations regardless of their type.Fail
n
following journal operations regardless of their type. Fails operations with thecause
exception.- Definition Classes
- PolicyOpsTestKit
- def failNextNOps(n: Int): Unit
Fail n following journal operations regardless of their type.
Fail n following journal operations regardless of their type. Fails operations with default
ExpectedFailure
exception.- Definition Classes
- PolicyOpsTestKit
- def failNextNOpsCond(cond: (String, SnapshotOperation) => Boolean, n: Int, cause: Throwable): Unit
Fail
n
following journal operations depending on the conditioncond
.Fail
n
following journal operations depending on the conditioncond
. Failure triggers, whencond
returns true. Fails operations with thecause
exception.- Definition Classes
- PolicyOpsTestKit
- def failNextNOpsCond(cond: (String, SnapshotOperation) => Boolean, n: Int): Unit
Fail
n
following journal operations depending on the conditioncond
.Fail
n
following journal operations depending on the conditioncond
. Failure triggers, whencond
returns true. Fails operations with defaultExpectedFailure
exception.- Definition Classes
- PolicyOpsTestKit
- def failNextNPersisted(n: Int, cause: Throwable): Unit
Fail next
n
write operations with thecause
exception for any persistence id.Fail next
n
write operations with thecause
exception for any persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next
n
write operations with thecause
exception for particular persistence id.Fail next
n
write operations with thecause
exception for particular persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNPersisted(n: Int): Unit
Fail next
n
write operations with default exception for any persistence id.Fail next
n
write operations with default exception for any persistence id.- Definition Classes
- CommonTestKitOps
- def failNextNPersisted(persistenceId: String, n: Int): Unit
Fail next
n
write operations for particular persistence id.Fail next
n
write operations for particular persistence id.- Definition Classes
- CommonTestKitOps
- def failNextNReads(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next n read from storage (recovery) attempts with
cause
exception for particular persistence id.Fail next n read from storage (recovery) attempts with
cause
exception for particular persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNReads(n: Int, cause: Throwable): Unit
Fail next n read from storage (recovery) attempts with
cause
exception for any persistence id.Fail next n read from storage (recovery) attempts with
cause
exception for any persistence id.- Definition Classes
- SnapshotTestKit → CommonTestKitOps
- def failNextNReads(persistenceId: String, n: Int): Unit
Fail next n read from storage (recovery) attempts with default exception for particular persistence id.
Fail next n read from storage (recovery) attempts with default exception for particular persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextNReads(n: Int): Unit
Fail next n read from storage (recovery) attempts with default exception for any persistence id.
Fail next n read from storage (recovery) attempts with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextPersisted(): Unit
Fail next write operation with default exception for any persistence id.
Fail next write operation with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextPersisted(cause: Throwable): Unit
Fail next write operation with
cause
exception for any persistence id.Fail next write operation with
cause
exception for any persistence id.- Definition Classes
- CommonTestKitOps
- def failNextPersisted(persistenceId: String): Unit
Fail next write operation with default exception for particular persistence id.
Fail next write operation with default exception for particular persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextPersisted(persistenceId: String, cause: Throwable): Unit
Fail next write operation with
cause
exception for particular persistence id.Fail next write operation with
cause
exception for particular persistence id.- Definition Classes
- CommonTestKitOps
- def failNextRead(persistenceId: String): Unit
Fail next read from storage (recovery) attempt with default exception for any persistence id.
Fail next read from storage (recovery) attempt with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextRead(persistenceId: String, cause: Throwable): Unit
Fail next read from storage (recovery) attempt with
cause
exception for particular persistence id.Fail next read from storage (recovery) attempt with
cause
exception for particular persistence id.- Definition Classes
- CommonTestKitOps
- def failNextRead(): Unit
Fail next read from storage (recovery) attempt with default exception for any persistence id.
Fail next read from storage (recovery) attempt with default exception for any persistence id.
- Definition Classes
- CommonTestKitOps
- def failNextRead(cause: Throwable): Unit
Fail next read from storage (recovery) attempt with
cause
exception for any persistence id.Fail next read from storage (recovery) attempt with
cause
exception for any persistence id.- Definition Classes
- CommonTestKitOps
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getItem(persistenceId: String, nextInd: Int): Option[Any]
- Definition Classes
- SnapshotTestKit → ExpectOps
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def persistForRecovery(persistenceId: String, elem: (SnapshotMeta, Any)): Unit
Persist a pair of (snapshot metadata, snapshot payload) into storage.
- def persistForRecovery(persistenceId: String, elems: Seq[(SnapshotMeta, Any)]): Unit
Persist
elems
pairs of (snapshot metadata, snapshot payload) into storage. - def persistedInStorage(persistenceId: String): Seq[(SnapshotMeta, Any)]
Retrieve snapshots and their metadata from storage by persistence id.
- def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A], max: FiniteDuration): Seq[A]
Receive for
max
time nextn
events/snapshots that have been persisted in the storage.Receive for
max
time nextn
events/snapshots that have been persisted in the storage.- Definition Classes
- ExpectOps
- def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A]): Seq[A]
Receive next
n
events/snapshots that have been persisted in the storage.Receive next
n
events/snapshots that have been persisted in the storage.- Definition Classes
- ExpectOps
- def receivePersisted[A](persistenceId: String, n: Int)(implicit t: ClassTag[A]): Seq[A]
Receive next
n
events/snapshots that have been persisted in the storage.Receive next
n
events/snapshots that have been persisted in the storage.- Definition Classes
- ExpectOps
- def receivePersisted[A](persistenceId: String, n: Int, max: FiniteDuration)(implicit t: ClassTag[A]): Seq[A]
Receive for
max
time nextn
events/snapshots that have been persisted in the storage.Receive for
max
time nextn
events/snapshots that have been persisted in the storage.- Definition Classes
- ExpectOps
- def resetPolicy(): Unit
Returns default policy if it was changed by PolicyOpsTestKit.this.withPolicy().
Returns default policy if it was changed by PolicyOpsTestKit.this.withPolicy().
- Definition Classes
- PolicyOpsTestKit
- val storage: SnapshotStorage
- Attributes
- protected
- Definition Classes
- SnapshotTestKit → HasStorage
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withPolicy(policy: SnapshotStorage.SnapshotPolicies.PolicyType): SnapshotTestKit.this.type
Set new processing policy for journal operations.
Set new processing policy for journal operations. NOTE! Overrides previously invoked
failNext...
orrejectNext...
- Definition Classes
- PolicyOpsTestKit
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
- Deprecated
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toStringFormat[SnapshotTestKit] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (SnapshotTestKit, B)
- Implicit
- This member is added by an implicit conversion from SnapshotTestKit toArrowAssoc[SnapshotTestKit] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.