Packages

class PersistenceTestKit extends PersistenceTestKitOps[PersistentRepr, JournalOperation] with ExpectOps[PersistentRepr] with HasStorage[JournalOperation, PersistentRepr]

Class for testing events of persistent actors.

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

Annotations
@ApiMayChange()
Source
PersistenceTestKit.scala
Linear Supertypes
HasStorage[JournalOperation, PersistentRepr], ExpectOps[PersistentRepr], PersistenceTestKitOps[PersistentRepr, JournalOperation], CommonTestKitOps[PersistentRepr, JournalOperation], PolicyOpsTestKit[JournalOperation], ClearOps, ClearPreservingSeqNums, RejectSupport[JournalOperation], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PersistenceTestKit
  2. HasStorage
  3. ExpectOps
  4. PersistenceTestKitOps
  5. CommonTestKitOps
  6. PolicyOpsTestKit
  7. ClearOps
  8. ClearPreservingSeqNums
  9. RejectSupport
  10. AnyRef
  11. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PersistenceTestKit(system: ActorSystem)

Value Members

  1. 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()

  2. def clearAllPreservingSeqNumbers(): Unit

    Clear all data in the storage preserving sequence numbers.

    Clear all data in the storage preserving sequence numbers.

    Definition Classes
    ClearPreservingSeqNums
    See also

    ClearOps.clearAll()

  3. def clearByIdPreservingSeqNumbers(persistenceId: String): Unit

    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.

    Definition Classes
    ClearPreservingSeqNums
    See also

    ClearOps.clearByPersistenceId()

  4. 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()

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

    Definition Classes
    ExpectOps
  6. 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
    ExpectOps
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
    PersistenceTestKit → CommonTestKitOps
  18. 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
    PersistenceTestKit → CommonTestKitOps
  19. 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
  20. 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
  21. 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 the cause exception.

    Definition Classes
    PolicyOpsTestKit
  22. 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
  23. def failNextNOpsCond(cond: (String, JournalOperation) => Boolean, n: Int, cause: Throwable): Unit

    Fail n following journal operations depending on the condition cond.

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

    Definition Classes
    PolicyOpsTestKit
  24. def failNextNOpsCond(cond: (String, JournalOperation) => Boolean, n: Int): Unit

    Fail n following journal operations depending on the condition cond.

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

    Definition Classes
    PolicyOpsTestKit
  25. 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.

    Definition Classes
    PersistenceTestKit → CommonTestKitOps
  26. 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.

    Definition Classes
    PersistenceTestKit → CommonTestKitOps
  27. 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
  28. 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
  29. 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
    PersistenceTestKit → CommonTestKitOps
  30. 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
    PersistenceTestKit → CommonTestKitOps
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. def getItem(persistenceId: String, nextInd: Int): Option[Any]
    Definition Classes
    ExpectOps
  42. def persistForRecovery(persistenceId: String, events: Seq[Any]): Unit

    Persist snapshots into storage in order.

    Persist snapshots into storage in order.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  43. def persistedInStorage(persistenceId: String): Seq[Any]

    Retrieve all snapshots saved in storage by persistence id.

    Retrieve all snapshots saved in storage by persistence id.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  44. 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.

    Definition Classes
    ExpectOps
  45. 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
  46. 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
  47. 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.

    Definition Classes
    ExpectOps
  48. 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.

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

    Definition Classes
    PersistenceTestKitOps
  50. def rejectNextDelete(cause: Throwable): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  51. def rejectNextDelete(): Unit

    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.

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

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  53. 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.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  54. 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.

    Definition Classes
    PersistenceTestKitOps
  55. def rejectNextNDeletes(n: Int): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  56. 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 the cause exception.

    Definition Classes
    RejectSupport
  57. 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.

    Definition Classes
    RejectSupport
  58. def rejectNextNOpsCond(cond: (String, JournalOperation) => Boolean, n: Int, cause: Throwable): Unit

    Reject n following journal operations depending on the condition cond.

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

    Definition Classes
    RejectSupport
  59. def rejectNextNOpsCond(cond: (String, JournalOperation) => Boolean, n: Int): Unit

    Reject n following journal operations depending on the condition cond.

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

    Definition Classes
    RejectSupport
  60. 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.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  61. 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.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  62. def rejectNextNPersisted(n: Int): Unit

    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.

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

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

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  65. 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.

    Definition Classes
    PersistenceTestKit → PersistenceTestKitOps
  66. 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.

    Definition Classes
    PersistenceTestKitOps
  67. def rejectNextNReads(n: Int): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  68. def rejectNextPersisted(): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  69. def rejectNextPersisted(cause: Throwable): Unit

    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.

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

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

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

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

    Definition Classes
    PersistenceTestKitOps
  74. def rejectNextRead(cause: Throwable): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  75. def rejectNextRead(): Unit

    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.

    Definition Classes
    PersistenceTestKitOps
  76. 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
  77. def withPolicy(policy: EventStorage.JournalPolicies.PolicyType): PersistenceTestKit.this.type

    Set new processing policy for journal operations.

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

    Definition Classes
    PolicyOpsTestKit