SnapshotTestKit

org.apache.pekko.persistence.testkit.scaladsl.SnapshotTestKit
See theSnapshotTestKit companion object

Class for testing snapshots of persistent actors.

NOTE! ActorSystem must be configured with PersistenceTestKitSnapshotPlugin. The configuration can be retrieved with PersistenceTestKitSnapshotPlugin.config.

Attributes

Companion
object
Source
PersistenceTestKit.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override 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.

Attributes

Definition Classes
ExpectOps -> CommonTestKitOps
Source
PersistenceTestKit.scala
override 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.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override 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.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override def failNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit

Fail next n write operations with the cause exception for particular persistence id.

Fail next n write operations with the cause exception for particular persistence id.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override def failNextNPersisted(n: Int, cause: Throwable): Unit

Fail next n write operations with the cause exception for any persistence id.

Fail next n write operations with the cause exception for any persistence id.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override 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.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override 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.

Attributes

Definition Classes
CommonTestKitOps
Source
PersistenceTestKit.scala
override def getItem(persistenceId: String, nextInd: Int): Option[Any]

Attributes

Definition Classes
ExpectOps
Source
PersistenceTestKit.scala
def persistForRecovery(persistenceId: String, elems: Seq[(SnapshotMeta, Any)]): Unit

Persist elems pairs of (snapshot metadata, snapshot payload) into storage.

Persist elems pairs of (snapshot metadata, snapshot payload) into storage.

Attributes

Source
PersistenceTestKit.scala
def persistForRecovery(persistenceId: String, elem: (SnapshotMeta, Any)): Unit

Persist a pair of (snapshot metadata, snapshot payload) into storage.

Persist a pair of (snapshot metadata, snapshot payload) into storage.

Attributes

Source
PersistenceTestKit.scala
def persistedInStorage(persistenceId: String): Seq[(SnapshotMeta, Any)]

Retrieve snapshots and their metadata from storage by persistence id.

Retrieve snapshots and their metadata from storage by persistence id.

Attributes

Source
PersistenceTestKit.scala

Inherited methods

def clearAll(): Unit

Clear all data from the storage.

Clear all data from the storage.

NOTE! Also clears sequence numbers in storage!

Attributes

See also

ClearPreservingSeqNums.clearAllPreservingSeqNumbers

Inherited from:
ClearOps (hidden)
Source
TestOps.scala
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!

Attributes

See also

ClearPreservingSeqNums.clearByIdPreservingSeqNumbers

Inherited from:
ClearOps (hidden)
Source
TestOps.scala
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 was event.

Check for max time that next persisted in storage for particular persistence id event/snapshot was event.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
def failNextNOps(n: Int, cause: Throwable): Unit

Fail n following journal operations regardless of their type. Fails operations with the cause exception.

Fail n following journal operations regardless of their type. Fails operations with the cause exception.

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala
def failNextNOps(n: Int): Unit

Fail n following journal operations regardless of their type. Fails operations with default ExpectedFailure exception.

Fail n following journal operations regardless of their type. Fails operations with default ExpectedFailure exception.

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala

Fail n following journal operations depending on the condition cond. Failure triggers, when cond returns true. Fails operations with the cause exception.

Fail n following journal operations depending on the condition cond. Failure triggers, when cond returns true. Fails operations with the cause exception.

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala

Fail n following journal operations depending on the condition cond. Failure triggers, when cond returns true. Fails operations with default ExpectedFailure exception.

Fail n following journal operations depending on the condition cond. Failure triggers, when cond returns true. Fails operations with default ExpectedFailure exception.

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala

Fail next n write operations with default exception for any persistence id.

Fail next n write operations with default exception for any persistence id.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

Fail next write operation with default exception for any persistence id.

Fail next write operation with default exception for any persistence id.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

Fail next write operation with cause exception for any persistence id.

Fail next write operation with cause exception for any persistence id.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala

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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
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.

Attributes

Inherited from:
CommonTestKitOps (hidden)
Source
PersistenceTestKit.scala
def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A], max: FiniteDuration): Seq[A]

Receive for max time next n events/snapshots that have been persisted in the storage.

Receive for max time next n events/snapshots that have been persisted in the storage.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
def receivePersisted[A](persistenceId: String, n: Int, max: FiniteDuration)(implicit t: ClassTag[A]): Seq[A]

Receive for max time next n events/snapshots that have been persisted in the storage.

Receive for max time next n events/snapshots that have been persisted in the storage.

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.scala
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().

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala
def withPolicy(policy: Policies.PolicyType): PolicyOpsTestKit.this.type

Set new processing policy for journal operations. NOTE! Overrides previously invoked failNext... or rejectNext...

Set new processing policy for journal operations. NOTE! Overrides previously invoked failNext... or rejectNext...

Attributes

Inherited from:
PolicyOpsTestKit (hidden)
Source
TestOps.scala