Class SnapshotStoreSpec

java.lang.Object
org.apache.pekko.persistence.PluginSpec
org.apache.pekko.persistence.snapshot.SnapshotStoreSpec
All Implemented Interfaces:
Serializable, CapabilityFlags, MayVerb, OptionalTests, SnapshotStoreCapabilityFlags, TestKitBase, org.scalactic.Explicitly, org.scalactic.Tolerance, org.scalactic.TripleEquals, org.scalactic.TripleEqualsSupport, org.scalatest.Alerting, org.scalatest.Assertions, org.scalatest.BeforeAndAfterAll, org.scalatest.BeforeAndAfterEach, org.scalatest.Documenting, org.scalatest.Informing, org.scalatest.matchers.dsl.MatcherWords, org.scalatest.matchers.should.Matchers, org.scalatest.Notifying, org.scalatest.Suite, org.scalatest.SuiteMixin, org.scalatest.TestRegistration, org.scalatest.TestSuite, org.scalatest.verbs.CanVerb, org.scalatest.verbs.MustVerb, org.scalatest.verbs.ShouldVerb, org.scalatest.wordspec.AnyWordSpecLike
Direct Known Subclasses:
JavaSnapshotStoreSpec

public abstract class SnapshotStoreSpec extends PluginSpec implements MayVerb, OptionalTests, SnapshotStoreCapabilityFlags
This spec aims to verify custom pekko-persistence SnapshotStore implementations. Plugin authors are highly encouraged to include it in their plugin's test suites.

In case your journal plugin needs some kind of setup or teardown, override the beforeAll or afterAll methods (don't forget to call super in your overridden methods).

For a Java and JUnit consumable version of the TCK please refer to pekko.persistence.japi.snapshot.JavaSnapshotStoreSpec.

See Also:
  • Constructor Details

    • SnapshotStoreSpec

      public SnapshotStoreSpec(com.typesafe.config.Config config)
  • Method Details

    • config

      public static com.typesafe.config.Config config()
    • system

      public ActorSystem system()
      Specified by:
      system in interface TestKitBase
    • supportsSerialization

      protected CapabilityFlag supportsSerialization()
      Description copied from interface: SnapshotStoreCapabilityFlags
      When true enables tests which check if the snapshot store properly serialize and deserialize snapshots.
      Specified by:
      supportsSerialization in interface SnapshotStoreCapabilityFlags
    • supportsMetadata

      protected CapabilityFlag supportsMetadata()
      Description copied from interface: SnapshotStoreCapabilityFlags
      When true enables tests which check if the snapshot store properly stores and loads metadata (needed for replication) along with the snapshots
      Specified by:
      supportsMetadata in interface SnapshotStoreCapabilityFlags
    • beforeEach

      protected void beforeEach()
      Specified by:
      beforeEach in interface org.scalatest.BeforeAndAfterEach
      Overrides:
      beforeEach in class PluginSpec
    • snapshotStore

      public ActorRef snapshotStore()
    • writeSnapshots

      public scala.collection.immutable.Seq<SnapshotMetadata> writeSnapshots()
    • snapshotByteSizeLimit

      public int snapshotByteSizeLimit()
      The limit defines a number of bytes persistence plugin can support to store the snapshot. If plugin does not support persistence of the snapshots of 10000 bytes or may support more than default size, the value can be overridden by the SnapshotStoreSpec implementation with a note in a plugin documentation.