Packages

class SnapshotTestKit extends CommonTestKitOps[(SnapshotMetadata, Any), SnapshotOperation] with PolicyOpsTestKit[SnapshotOperation] with ExpectOps[(SnapshotMetadata, Any)] with HasStorage[SnapshotOperation, (SnapshotMetadata, Any)]

Class for testing snapshots of persistent actors.

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

Annotations
@ApiMayChange()
Source
PersistenceTestKit.scala
Linear Supertypes
HasStorage[SnapshotOperation, (SnapshotMetadata, Any)], ExpectOps[(SnapshotMetadata, Any)], CommonTestKitOps[(SnapshotMetadata, Any), SnapshotOperation], PolicyOpsTestKit[SnapshotOperation], ClearOps, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SnapshotTestKit
  2. HasStorage
  3. ExpectOps
  4. CommonTestKitOps
  5. PolicyOpsTestKit
  6. ClearOps
  7. AnyRef
  8. 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 SnapshotTestKit(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 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()

  3. 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
    SnapshotTestKit → ExpectOps → CommonTestKitOps
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
    SnapshotTestKit → CommonTestKitOps
  16. 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
    SnapshotTestKit → CommonTestKitOps
  17. 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
  18. 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
  19. 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
  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.

    Definition Classes
    PolicyOpsTestKit
  21. def failNextNOpsCond(cond: (String, SnapshotOperation) => 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
  22. def failNextNOpsCond(cond: (String, SnapshotOperation) => 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
  23. 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
    SnapshotTestKit → CommonTestKitOps
  24. 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
    SnapshotTestKit → CommonTestKitOps
  25. 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
  26. 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
  27. 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
    SnapshotTestKit → CommonTestKitOps
  28. 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
    SnapshotTestKit → CommonTestKitOps
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. def getItem(persistenceId: String, nextInd: Int): Option[Any]
    Definition Classes
    SnapshotTestKit → ExpectOps
  40. def persistForRecovery(persistenceId: String, elem: (SnapshotMeta, Any)): Unit

    Persist a pair of (snapshot metadata, snapshot payload) into storage.

  41. def persistForRecovery(persistenceId: String, elems: Seq[(SnapshotMeta, Any)]): Unit

    Persist elems pairs of (snapshot metadata, snapshot payload) into storage.

  42. def persistedInStorage(persistenceId: String): Seq[(SnapshotMeta, Any)]

    Retrieve snapshots and their metadata from storage by persistence id.

  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. def withPolicy(policy: SnapshotStorage.SnapshotPolicies.PolicyType): SnapshotTestKit.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