Packages

class SnapshotTestKit extends AnyRef

Class for testing persisted snapshots in persistent actors.

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

Value Members

  1. def clearAll(): Unit

    Clear all data from storage.

  2. def clearByPersistenceId(persistenceId: String): Unit

    Clear all data from storage for particular persistence id.

  3. def expectNextPersisted[A](persistenceId: String, snapshot: A, max: Duration): A

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

  4. def expectNextPersisted[A](persistenceId: String, snapshot: A): A

    Check that snapshot has been saved in the storage.

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

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

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

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

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

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

  8. def expectNothingPersisted(persistenceId: String): Unit

    Check that nothing has been saved in the storage.

  9. def failNextDelete(persistenceId: String): Unit

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

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

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

  11. def failNextDelete(): Unit

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

  12. def failNextDelete(cause: Throwable): Unit

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

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

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

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

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

  15. def failNextNDeletes(n: Int): Unit

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

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

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

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

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

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

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

  21. def failNextNPersisted(n: Int): Unit

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

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

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

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

    Fail next n write operations for particular persistence id.

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

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

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

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

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

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

  27. def failNextNReads(n: Int): Unit

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

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

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

  29. def failNextPersisted(): Unit

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

  30. def failNextPersisted(cause: Throwable): Unit

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

  31. def failNextPersisted(persistenceId: String): Unit

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

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

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

  33. def failNextRead(persistenceId: String): Unit

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

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

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

  35. def failNextRead(): Unit

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

  36. def failNextRead(cause: Throwable): Unit

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

  37. def persistForRecovery(persistenceId: String, snapshots: List[Pair[SnapshotMeta, Any]]): Unit

    Persist snapshots with metadata into storage in order.

  38. def persistedInStorage(persistenceId: String): List[Pair[SnapshotMeta, Any]]

    Retrieve all snapshots and their metadata saved in storage by persistence id.

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

    Receive for max time next n snapshots that have been persisted in the storage.

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

    Receive next n snapshots that have been persisted in the storage.

  41. def resetPolicy(): Unit

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

  42. def withPolicy(policy: SnapshotStorage.SnapshotPolicies.PolicyType): SnapshotTestKit

    Set new processing policy for journal operations.

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