PersistenceTestKit

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

Class for testing persisted events in persistent actors.

Attributes

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

Members list

Value members

Constructors

def this(system: ActorSystem)

Attributes

Source
PersistenceTestKit.scala

Concrete methods

def clearAll(): Unit

Clear all data from storage.

Clear all data from storage.

NOTE! Also clears sequence numbers in storage!

Attributes

See also
Source
PersistenceTestKit.scala

Clear all data in storage preserving sequence numbers.

Clear all data in storage preserving sequence numbers.

Attributes

See also
Source
PersistenceTestKit.scala

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

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

Attributes

See also
Source
PersistenceTestKit.scala
def clearByPersistenceId(persistenceId: String): Unit

Clear all data from storage for particular persistence id.

Clear all data from storage for particular persistence id.

NOTE! Also clears sequence number in storage!

Attributes

See also
Source
PersistenceTestKit.scala
def expectNextPersisted[A](persistenceId: String, event: A): A

Check that event has been saved in the storage.

Check that event has been saved in the storage.

Attributes

Source
PersistenceTestKit.scala
def expectNextPersisted[A](persistenceId: String, event: A, max: Duration): A

Check for max time that event has been saved in the storage.

Check for max time that event has been saved in the storage.

Attributes

Source
PersistenceTestKit.scala
def expectNextPersistedClass[A](persistenceId: String, cla: Class[A]): A

Check that next persisted in storage for particular persistence id event has expected type.

Check that next persisted in storage for particular persistence id event has expected type.

Attributes

Source
PersistenceTestKit.scala
def expectNextPersistedClass[A](persistenceId: String, cla: Class[A], max: Duration): A

Check for max time that next persisted in storage for particular persistence id event has expected type.

Check for max time that next persisted in storage for particular persistence id event has expected type.

Attributes

Source
PersistenceTestKit.scala
def expectNothingPersisted(persistenceId: String): Unit

Check that nothing has been saved in the storage.

Check that nothing has been saved in the storage.

Attributes

Source
PersistenceTestKit.scala
def expectNothingPersisted(persistenceId: String, max: Duration): Unit

Check for max time that nothing has been saved in the storage.

Check for max time that nothing has been saved in the storage.

Attributes

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

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

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

Source
PersistenceTestKit.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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.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

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

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

Source
PersistenceTestKit.scala
def failNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int): Unit

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

Source
PersistenceTestKit.scala
def failNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int, cause: Throwable): Unit

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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.scala

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

Source
PersistenceTestKit.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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.scala
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

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

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

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

Source
PersistenceTestKit.scala

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

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

Attributes

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

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

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

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

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

Source
PersistenceTestKit.scala
def persistForRecovery(persistenceId: String, events: List[Any]): Unit

Persist events into storage in order.

Persist events into storage in order.

Attributes

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

Retrieve all events saved in storage by persistence id.

Retrieve all events saved in storage by persistence id.

Attributes

Source
PersistenceTestKit.scala
def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A]): List[A]

Receive next n events from the storage.

Receive next n events from the storage.

Attributes

Source
PersistenceTestKit.scala
def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A], max: Duration): List[A]

Receive for max time next n events from the storage.

Receive for max time next n events from the storage.

Attributes

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

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

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

Source
PersistenceTestKit.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

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

Source
PersistenceTestKit.scala

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

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

Source
PersistenceTestKit.scala
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

Source
PersistenceTestKit.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

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

Source
PersistenceTestKit.scala
def rejectNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int): Unit

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

Source
PersistenceTestKit.scala
def rejectNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int, cause: Throwable): Unit

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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.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

Source
PersistenceTestKit.scala

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

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

Source
PersistenceTestKit.scala
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

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

Source
PersistenceTestKit.scala
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

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

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

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

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

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

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

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

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

Source
PersistenceTestKit.scala
def resetPolicy(): Unit

Returns default policy if it was changed by withPolicy.

Returns default policy if it was changed by withPolicy.

Attributes

Source
PersistenceTestKit.scala
def withPolicy(policy: PolicyType): PersistenceTestKit

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

Source
PersistenceTestKit.scala