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
- 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 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
- def getItem(persistenceId: String, nextInd: Int): Option[Any]
- Definition Classes
- SnapshotTestKit → ExpectOps
- 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
- 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