PersistenceTestKit

org.apache.pekko.persistence.testkit.scaladsl.PersistenceTestKit
See thePersistenceTestKit companion object

Class for testing events of persistent actors.

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

Attributes

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

Members list

Value members

Concrete methods

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
def persistForRecovery(persistenceId: String, events: Seq[Any]): Unit

Persist snapshots into storage in order.

Persist snapshots into storage in order.

Attributes

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

Retrieve all snapshots saved in storage by persistence id.

Retrieve all snapshots saved in storage by persistence id.

Attributes

Source
PersistenceTestKit.scala
override def rejectNextNDeletes(n: Int, cause: Throwable): Unit

Reject next n delete from storage operations for any persistence id with cause exception.

Reject next n delete from storage operations for any persistence id with cause exception.

Attributes

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

Reject next n delete from storage operations for particular persistence id with cause exception.

Reject next n delete from storage operations for particular persistence id with cause exception.

Attributes

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

Reject next n save in storage operations for particular persistence id with cause exception.

Reject next n save in storage operations for particular persistence id with cause exception.

Attributes

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

Reject next n save in storage operations for any persistence id with cause exception.

Reject next n save in storage operations for any persistence id with cause exception.

Attributes

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

Reject next n read from storage operations for any persistence id with cause exception.

Reject next n read from storage operations for any persistence id with cause exception.

Attributes

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

Reject next n read from storage operations for particular persistence id with cause exception.

Reject next n read from storage operations for particular persistence id with cause exception.

Attributes

Definition Classes
PersistenceTestKitOps
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

Clear all data in the storage preserving sequence numbers.

Clear all data in the storage preserving sequence numbers.

Attributes

See also

ClearOps.clearAll

Inherited from:
ClearPreservingSeqNums (hidden)
Source
TestOps.scala

Clear all data in the storage for particular persistence id preserving sequence numbers.

Clear all data in the storage for particular persistence id preserving sequence numbers.

Attributes

See also

ClearOps.clearByPersistenceId

Inherited from:
ClearPreservingSeqNums (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 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

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 getItem(persistenceId: String, nextInd: Int): Option[Any]

Attributes

Inherited from:
ExpectOps (hidden)
Source
TestOps.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 rejectNextDelete(persistenceId: String, cause: Throwable): Unit

Reject next delete from storage operations for particular persistence id with cause exception.

Reject next delete from storage operations for particular persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextDelete(persistenceId: String): Unit

Reject next delete from storage operations for particular persistence id with default exception.

Reject next delete from storage operations for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next delete from storage operation for any persistence id with cause exception.

Reject next delete from storage operation for any persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next delete from storage operation for any persistence id with default exception.

Reject next delete from storage operation for any persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextNDeletes(persistenceId: String, n: Int): Unit

Reject next n delete from storage operations for particular persistence id with default exception.

Reject next n delete from storage operations for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next n delete from storage operations for any persistence id with default exception.

Reject next n delete from storage operations for any persistence id with default exception.

Attributes

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

Reject n following journal operations regardless of their type. Rejects operations with the cause exception.

Reject n following journal operations regardless of their type. Rejects operations with the cause exception.

Attributes

Inherited from:
RejectSupport (hidden)
Source
TestOps.scala

Reject n following journal operations regardless of their type. Rejects operations with default ExpectedRejection exception.

Reject n following journal operations regardless of their type. Rejects operations with default ExpectedRejection exception.

Attributes

Inherited from:
RejectSupport (hidden)
Source
TestOps.scala

Reject n following journal operations depending on the condition cond. Rejection triggers, when cond returns true. Rejects operations with the cause exception.

Reject n following journal operations depending on the condition cond. Rejection triggers, when cond returns true. Rejects operations with the cause exception.

Attributes

Inherited from:
RejectSupport (hidden)
Source
TestOps.scala

Reject n following journal operations depending on the condition cond. Rejection triggers, when cond returns true. Reject operations with default ExpectedRejection exception.

Reject n following journal operations depending on the condition cond. Rejection triggers, when cond returns true. Reject operations with default ExpectedRejection exception.

Attributes

Inherited from:
RejectSupport (hidden)
Source
TestOps.scala

Reject next n save in storage operations for any persistence id with default exception.

Reject next n save in storage operations for any persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextNPersisted(persistenceId: String, n: Int): Unit

Reject next n save in storage operations for particular persistence id with default exception.

Reject next n save in storage operations for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextNReads(persistenceId: String, n: Int): Unit

Reject next n read from storage operations for particular persistence id with default exception.

Reject next n read from storage operations for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next n read from storage operations for any persistence id with default exception.

Reject next n read from storage operations for any persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next save in storage operation for any persistence id with default exception.

Reject next save in storage operation for any persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next save in storage operation for any persistence id with cause exception.

Reject next save in storage operation for any persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextPersisted(persistenceId: String, cause: Throwable): Unit

Reject next save in storage operation for particular persistence id with cause exception.

Reject next save in storage operation for particular persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextPersisted(persistenceId: String): Unit

Reject next save in storage operation for particular persistence id with default exception.

Reject next save in storage operation for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextRead(persistenceId: String, cause: Throwable): Unit

Reject next read from storage operation for particular persistence id with cause exception.

Reject next read from storage operation for particular persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala
def rejectNextRead(persistenceId: String): Unit

Reject next read from storage operation for particular persistence id with default exception.

Reject next read from storage operation for particular persistence id with default exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next read from storage operation for any persistence id with cause exception.

Reject next read from storage operation for any persistence id with cause exception.

Attributes

Inherited from:
PersistenceTestKitOps (hidden)
Source
PersistenceTestKit.scala

Reject next read from storage operation for any persistence id with default exception.

Reject next read from storage operation for any persistence id with default exception.

Attributes

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