class PersistenceTestKit extends AnyRef
Class for testing persisted events in persistent actors.
- Annotations
- @ApiMayChange()
- Source
- PersistenceTestKit.scala
- Alphabetic
- By Inheritance
- PersistenceTestKit
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PersistenceTestKit(system: ActorSystem)
- new PersistenceTestKit(scalaTestkit: scaladsl.PersistenceTestKit)
Value Members
- def clearAll(): Unit
Clear all data from storage.
Clear all data from storage.
NOTE! Also clears sequence numbers in storage!
- See also
PersistenceTestKit.clearAllPreservingSeqNumbers()
- def clearAllPreservingSeqNumbers(): Unit
Clear all data in storage preserving sequence numbers.
Clear all data in storage preserving sequence numbers.
- See also
PersistenceTestKit.clearAll()
- def clearByIdPreservingSeqNumbers(persistenceId: String): Unit
Clear all data in storage for particular persistence id preserving sequence numbers.
Clear all data in storage for particular persistence id preserving sequence numbers.
- See also
PersistenceTestKit.clearByPersistenceId()
- 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!
- See also
PersistenceTestKit.clearByIdPreservingSeqNumbers()
- def expectNextPersisted[A](persistenceId: String, event: A, max: Duration): A
Check for
max
time thatevent
has been saved in the storage. - def expectNextPersisted[A](persistenceId: String, event: A): A
Check that
event
has been saved in the storage. - 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. - def expectNextPersistedClass[A](persistenceId: String, cla: Class[A]): A
Check that next persisted in storage for particular persistence id event has expected type.
- def expectNothingPersisted(persistenceId: String, max: Duration): Unit
Check for
max
time that nothing has been saved in the storage. - def expectNothingPersisted(persistenceId: String): Unit
Check that nothing has been saved in the storage.
- def failNextDelete(persistenceId: String): Unit
Fail next delete from storage attempt with default exception for particular persistence id.
- def failNextDelete(persistenceId: String, cause: Throwable): Unit
Fail next delete from storage attempt with
cause
exception for particular persistence id. - def failNextDelete(): Unit
Fail next delete from storage attempt with default exception for any persistence id.
- def failNextDelete(cause: Throwable): Unit
Fail next delete from storage attempt with
cause
exception for any persistence id. - def failNextNDeletes(persistenceId: String, n: Int): Unit
Fail next n delete from storage attempts with default exception for particular persistence id.
- def failNextNDeletes(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next n delete from storage attempts with
cause
exception for particular persistence id. - def failNextNDeletes(n: Int): Unit
Fail next n delete from storage attempts with default exception for any persistence id.
- def failNextNDeletes(n: Int, cause: Throwable): Unit
Fail next n delete from storage attempts with
cause
exception for any persistence id. - def failNextNOps(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. - 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. - def failNextNOpsCond(cond: BiFunction[String, JournalOperation, 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. - def failNextNOpsCond(cond: BiFunction[String, JournalOperation, 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. - def failNextNPersisted(n: Int): Unit
Fail next
n
write operations with default exception for any persistence id. - def failNextNPersisted(n: Int, cause: Throwable): Unit
Fail next
n
write operations with thecause
exception for any persistence id. - def failNextNPersisted(persistenceId: String, n: Int): Unit
Fail next
n
write operations for particular persistence id. - def failNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next
n
write operations with thecause
exception for particular persistence id. - def failNextNReads(persistenceId: String, n: Int): Unit
Fail next n read from storage (recovery) attempts with default exception for particular persistence id.
- def failNextNReads(persistenceId: String, n: Int, cause: Throwable): Unit
Fail next n read from storage (recovery) attempts with
cause
exception for particular persistence id. - def failNextNReads(n: Int): Unit
Fail next n read from storage (recovery) attempts with default exception for any persistence id.
- def failNextNReads(n: Int, cause: Throwable): Unit
Fail next n read from storage (recovery) attempts with
cause
exception for any persistence id. - def failNextPersisted(): Unit
Fail next write operation with default exception for any persistence id.
- def failNextPersisted(cause: Throwable): Unit
Fail next write operation event with
cause
exception for any persistence id. - def failNextPersisted(persistenceId: String): Unit
Fail next write operation with default exception for particular persistence id.
- def failNextPersisted(persistenceId: String, cause: Throwable): Unit
Fail next write operation with
cause
exception for particular persistence id. - def failNextRead(persistenceId: String): Unit
Fail next read from storage (recovery) attempt with default exception for any persistence id.
- def failNextRead(persistenceId: String, cause: Throwable): Unit
Fail next read from storage (recovery) attempt with
cause
exception for particular persistence id. - def failNextRead(): Unit
Fail next read from storage (recovery) attempt with default exception for any persistence id.
- def failNextRead(cause: Throwable): Unit
Fail next read from storage (recovery) attempt with
cause
exception for any persistence id. - def persistForRecovery(persistenceId: String, events: List[Any]): Unit
Persist
events
into storage in order. - def persistedInStorage(persistenceId: String): List[Any]
Retrieve all events saved in storage by persistence id.
- def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A], max: Duration): List[A]
Receive for
max
time next n events from the storage. - def receivePersisted[A](persistenceId: String, n: Int, cla: Class[A]): List[A]
Receive next n events from the storage.
- def rejectNextDelete(persistenceId: String, cause: Throwable): Unit
Reject next delete from storage operations for particular persistence id with
cause
exception. - def rejectNextDelete(persistenceId: String): Unit
Reject next delete from storage operations for particular persistence id with default exception.
- def rejectNextDelete(cause: Throwable): Unit
Reject next delete from storage operation for any persistence id with
cause
exception. - def rejectNextDelete(): Unit
Reject next delete from storage operation for any persistence id with default exception.
- def rejectNextNDeletes(persistenceId: String, n: Int, cause: Throwable): Unit
Reject next n delete from storage operations for particular persistence id with
cause
exception. - def rejectNextNDeletes(persistenceId: String, n: Int): Unit
Reject next n delete from storage operations for particular persistence id with default exception.
- def rejectNextNDeletes(n: Int, cause: Throwable): Unit
Reject next n delete from storage operations for any persistence id with
cause
exception. - def rejectNextNDeletes(n: Int): Unit
Reject next n delete from storage operations for any persistence id with default exception.
- def rejectNextNOps(n: Int, cause: Throwable): Unit
Reject
n
following journal operations regardless of their type.Reject
n
following journal operations regardless of their type. Rejects operations with thecause
exception. - def rejectNextNOps(n: Int): Unit
Reject n following journal operations regardless of their type.
Reject n following journal operations regardless of their type. Rejects operations with default
ExpectedRejection
exception. - def rejectNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int, cause: Throwable): Unit
Reject
n
following journal operations depending on the conditioncond
.Reject
n
following journal operations depending on the conditioncond
. Rejection triggers, whencond
returns true. Rejects operations with thecause
exception. - def rejectNextNOpsCond(cond: BiFunction[String, JournalOperation, Boolean], n: Int): Unit
Reject
n
following journal operations depending on the conditioncond
.Reject
n
following journal operations depending on the conditioncond
. Rejection triggers, whencond
returns true. Reject operations with defaultExpectedRejection
exception. - def rejectNextNPersisted(n: Int, cause: Throwable): Unit
Reject next n save in storage operations for any persistence id with
cause
exception. - def rejectNextNPersisted(n: Int): Unit
Reject next n save in storage operations for any persistence id with default exception.
- def rejectNextNPersisted(persistenceId: String, n: Int): Unit
Reject next n save in storage operations for particular persistence id with default exception.
- def rejectNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit
Reject next n save in storage operations for particular persistence id with
cause
exception. - def rejectNextNReads(persistenceId: String, n: Int, cause: Throwable): Unit
Reject next n read from storage operations for particular persistence id with
cause
exception. - def rejectNextNReads(persistenceId: String, n: Int): Unit
Reject next n read from storage operations for particular persistence id with default exception.
- def rejectNextNReads(n: Int, cause: Throwable): Unit
Reject next n read from storage operations for any persistence id with
cause
exception. - def rejectNextNReads(n: Int): Unit
Reject next n read from storage operations for any persistence id with default exception.
- def rejectNextPersisted(): Unit
Reject next save in storage operation for any persistence id with default exception.
- def rejectNextPersisted(cause: Throwable): Unit
Reject next save in storage operation for any persistence id with
cause
exception. - def rejectNextPersisted(persistenceId: String, cause: Throwable): Unit
Reject next save in storage operation for particular persistence id with
cause
exception. - def rejectNextPersisted(persistenceId: String): Unit
Reject next save in storage operation for particular persistence id with default exception.
- def rejectNextRead(persistenceId: String, cause: Throwable): Unit
Reject next read from storage operation for particular persistence id with
cause
exception. - def rejectNextRead(persistenceId: String): Unit
Reject next read from storage operation for particular persistence id with default exception.
- def rejectNextRead(cause: Throwable): Unit
Reject next read from storage operation for any persistence id with
cause
exception. - def rejectNextRead(): Unit
Reject next read from storage operation for any persistence id with default exception.
- def resetPolicy(): Unit
Returns default policy if it was changed by PersistenceTestKit.withPolicy().
- def withPolicy(policy: EventStorage.JournalPolicies.PolicyType): PersistenceTestKit
Set new processing policy for journal operations.
Set new processing policy for journal operations. NOTE! Overrides previously invoked
failNext...
orrejectNext...