From 420b52e6bef4d0e4e749123651258684149ef670 Mon Sep 17 00:00:00 2001 From: Debasish Ghosh Date: Wed, 28 Jul 2021 16:02:03 +0530 Subject: [PATCH] Minor fixes in tests and documentation (#30440) --- .../src/main/paradox/persistence-query-durable-state.md | 2 +- .../state/scaladsl/DurableStateBehaviorReplySpec.scala | 4 ++-- .../typed/state/scaladsl/NullEmptyStateSpec.scala | 3 +-- .../typed/state/scaladsl/PrimitiveStateSpec.scala | 8 +------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/akka-docs/src/main/paradox/persistence-query-durable-state.md b/akka-docs/src/main/paradox/persistence-query-durable-state.md index 81400830c9..20128a4f7d 100644 --- a/akka-docs/src/main/paradox/persistence-query-durable-state.md +++ b/akka-docs/src/main/paradox/persistence-query-durable-state.md @@ -35,7 +35,7 @@ durable state is stored in a database and fetched as an asynchronous stream to t durable state, provided by the `DurableStateStoreQuery` interface, is used to implement tag based searches in Akka Projections. -The example below shows how to get the `DurableStateStoreQuery` from the DurableStateStoreRegistry extension. +The example below shows how to get the `DurableStateStoreQuery` from the `DurableStateStoreRegistry` extension. Scala : @@snip [DurableStateStoreQueryUsageCompileOnlySpec.scala](/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/DurableStateStoreQueryUsageCompileOnlySpec.scala) { #get-durable-state-store-query-example } diff --git a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala index e40d4e0cc3..d683259151 100644 --- a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala +++ b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/DurableStateBehaviorReplySpec.scala @@ -80,7 +80,7 @@ class DurableStateBehaviorReplySpec "A typed persistent actor with commands that are expecting replies" must { - "persist an event thenReply" in { + "persist state thenReply" in { val c = spawn(counter(nextPid())) val probe = TestProbe[Done]() c ! IncrementWithConfirmation(probe.ref) @@ -92,7 +92,7 @@ class DurableStateBehaviorReplySpec probe.expectMessage(Done) } - "persist an event thenReply later" in { + "persist state thenReply later" in { val c = spawn(counter(nextPid())) val probe = TestProbe[Done]() c ! IncrementReplyLater(probe.ref) diff --git a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala index bde477ca29..ab632bdf49 100644 --- a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala +++ b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/NullEmptyStateSpec.scala @@ -42,7 +42,7 @@ class NullEmptyStateSpec }) "A typed persistent actor with primitive state" must { - "persist events and update state" in { + "persist and update state" in { val probe = TestProbe[String]() val b = primitiveState(PersistenceId.ofUniqueId("a"), probe.ref) val ref1 = spawn(b) @@ -54,7 +54,6 @@ class NullEmptyStateSpec probe.expectTerminated(ref1) val _ = spawn(b) - // no events, no replay and hence no messages probe.expectNoMessage() } } diff --git a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala index 916012469f..b2c4f0ecfd 100644 --- a/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala +++ b/akka-persistence-typed-tests/src/test/scala/akka/persistence/typed/state/scaladsl/PrimitiveStateSpec.scala @@ -4,10 +4,6 @@ package akka.persistence.typed.state.scaladsl -/* - * Copyright (C) 2018-2021 Lightbend Inc. - */ - import akka.actor.testkit.typed.scaladsl._ import akka.actor.typed.ActorRef import akka.actor.typed.Behavior @@ -39,7 +35,7 @@ class PrimitiveStateSpec }) "A typed persistent actor with primitive state" must { - "persist primitive events and update state" in { + "persist primitive state and update" in { val probe = TestProbe[String]() val b = primitiveState(PersistenceId.ofUniqueId("a"), probe.ref) val ref1 = spawn(b) @@ -52,11 +48,9 @@ class PrimitiveStateSpec probe.expectTerminated(ref1) val ref2 = spawn(b) - // no events, no replay and hence no messages probe.expectNoMessage() ref2 ! 3 probe.expectMessage("3") } - } }