Packages

class PersistenceTestKit extends AnyRef

Class for testing persisted events in persistent actors.

Annotations
@ApiMayChange()
Source
PersistenceTestKit.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PersistenceTestKit
  2. AnyRef
  3. 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)
  2. new PersistenceTestKit(scalaTestkit: scaladsl.PersistenceTestKit)

Value Members

  1. def clearAll(): Unit

    Clear all data from storage.

    Clear all data from storage.

    NOTE! Also clears sequence numbers in storage!

    See also

    PersistenceTestKit.clearAllPreservingSeqNumbers()

  2. def clearAllPreservingSeqNumbers(): Unit

    Clear all data in storage preserving sequence numbers.

    Clear all data in storage preserving sequence numbers.

    See also

    PersistenceTestKit.clearAll()

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

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

  5. def expectNextPersisted[A](persistenceId: String, event: A, max: Duration): A

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

  6. def expectNextPersisted[A](persistenceId: String, event: A): A

    Check that event has been saved in the storage.

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

  8. def expectNextPersistedClass[A](persistenceId: String, cla: Class[A]): A

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

  9. def expectNothingPersisted(persistenceId: String, max: Duration): Unit

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

  10. def expectNothingPersisted(persistenceId: String): Unit

    Check that nothing has been saved in the storage.

  11. def failNextDelete(persistenceId: String): Unit

    Fail next delete from storage attempt with default exception for particular persistence id.

  12. def failNextDelete(persistenceId: String, cause: Throwable): Unit

    Fail next delete from storage attempt with cause exception for particular persistence id.

  13. def failNextDelete(): Unit

    Fail next delete from storage attempt with default exception for any persistence id.

  14. def failNextDelete(cause: Throwable): Unit

    Fail next delete from storage attempt with cause exception for any persistence id.

  15. def failNextNDeletes(persistenceId: String, n: Int): Unit

    Fail next n delete from storage attempts with default exception for particular persistence id.

  16. def failNextNDeletes(persistenceId: String, n: Int, cause: Throwable): Unit

    Fail next n delete from storage attempts with cause exception for particular persistence id.

  17. def failNextNDeletes(n: Int): Unit

    Fail next n delete from storage attempts with default exception for any persistence id.

  18. def failNextNDeletes(n: Int, cause: Throwable): Unit

    Fail next n delete from storage attempts with cause exception for any persistence id.

  19. def failNextNOps(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.

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

  21. def failNextNOpsCond(cond: BiFunction[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.

  22. def failNextNOpsCond(cond: BiFunction[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.

  23. def failNextNPersisted(n: Int): Unit

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

  24. def failNextNPersisted(n: Int, cause: Throwable): Unit

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

  25. def failNextNPersisted(persistenceId: String, n: Int): Unit

    Fail next n write operations for particular persistence id.

  26. def failNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit

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

  27. def failNextNReads(persistenceId: String, n: Int): Unit

    Fail next n read from storage (recovery) attempts with default exception for particular persistence id.

  28. def failNextNReads(persistenceId: String, n: Int, cause: Throwable): Unit

    Fail next n read from storage (recovery) attempts with cause exception for particular persistence id.

  29. def failNextNReads(n: Int): Unit

    Fail next n read from storage (recovery) attempts with default exception for any persistence id.

  30. def failNextNReads(n: Int, cause: Throwable): Unit

    Fail next n read from storage (recovery) attempts with cause exception for any persistence id.

  31. def failNextPersisted(): Unit

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

  32. def failNextPersisted(cause: Throwable): Unit

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

  33. def failNextPersisted(persistenceId: String): Unit

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

  34. def failNextPersisted(persistenceId: String, cause: Throwable): Unit

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

  35. def failNextRead(persistenceId: String): Unit

    Fail next read from storage (recovery) attempt with default exception for any persistence id.

  36. def failNextRead(persistenceId: String, cause: Throwable): Unit

    Fail next read from storage (recovery) attempt with cause exception for particular persistence id.

  37. def failNextRead(): Unit

    Fail next read from storage (recovery) attempt with default exception for any persistence id.

  38. def failNextRead(cause: Throwable): Unit

    Fail next read from storage (recovery) attempt with cause exception for any persistence id.

  39. def persistForRecovery(persistenceId: String, events: List[Any]): Unit

    Persist events into storage in order.

  40. def persistedInStorage(persistenceId: String): List[Any]

    Retrieve all events saved in storage by persistence id.

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

    Receive for max time next n events from the storage.

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

    Receive next n events from the storage.

  43. def rejectNextDelete(persistenceId: String, cause: Throwable): Unit

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

  44. def rejectNextDelete(persistenceId: String): Unit

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

  45. def rejectNextDelete(cause: Throwable): Unit

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

  46. def rejectNextDelete(): Unit

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

  47. def rejectNextNDeletes(persistenceId: String, n: Int, cause: Throwable): Unit

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

  48. def rejectNextNDeletes(persistenceId: String, n: Int): Unit

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

  49. def rejectNextNDeletes(n: Int, cause: Throwable): Unit

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

  50. def rejectNextNDeletes(n: Int): Unit

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

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

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

  53. def rejectNextNOpsCond(cond: BiFunction[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.

  54. def rejectNextNOpsCond(cond: BiFunction[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.

  55. def rejectNextNPersisted(n: Int, cause: Throwable): Unit

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

  56. def rejectNextNPersisted(n: Int): Unit

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

  57. def rejectNextNPersisted(persistenceId: String, n: Int): Unit

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

  58. def rejectNextNPersisted(persistenceId: String, n: Int, cause: Throwable): Unit

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

  59. def rejectNextNReads(persistenceId: String, n: Int, cause: Throwable): Unit

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

  60. def rejectNextNReads(persistenceId: String, n: Int): Unit

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

  61. def rejectNextNReads(n: Int, cause: Throwable): Unit

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

  62. def rejectNextNReads(n: Int): Unit

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

  63. def rejectNextPersisted(): Unit

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

  64. def rejectNextPersisted(cause: Throwable): Unit

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

  65. def rejectNextPersisted(persistenceId: String, cause: Throwable): Unit

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

  66. def rejectNextPersisted(persistenceId: String): Unit

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

  67. def rejectNextRead(persistenceId: String, cause: Throwable): Unit

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

  68. def rejectNextRead(persistenceId: String): Unit

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

  69. def rejectNextRead(cause: Throwable): Unit

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

  70. def rejectNextRead(): Unit

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

  71. def resetPolicy(): Unit

    Returns default policy if it was changed by PersistenceTestKit.withPolicy().

  72. 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... or rejectNext...