diff --git a/.github/workflows/scala3-build.yml b/.github/workflows/scala3-build.yml index 44a17ae7cf..0536fe067c 100644 --- a/.github/workflows/scala3-build.yml +++ b/.github/workflows/scala3-build.yml @@ -21,7 +21,7 @@ jobs: - akka-testkit/test akka-actor-tests/test - akka-actor-testkit-typed/test akka-actor-typed-tests/test - akka-bench-jmh/test - - akka-cluster/Test/compile akka-cluster-tools/test akka-cluster-typed/test akka-distributed-data/test akka-cluster-metrics/Test akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/compile + - akka-cluster/Test/compile akka-cluster-tools/test akka-cluster-typed/test akka-distributed-data/test akka-cluster-metrics/test akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/test - akka-discovery/test akka-coordination/test - akka-persistence/test akka-persistence-shared/test akka-persistence-query/test akka-persistence-typed/test akka-persistence-testkit/test - akka-pki/test akka-slf4j/test diff --git a/.github/workflows/scala3-compile.yml b/.github/workflows/scala3-compile.yml index fff98d3d58..9cf6013c6b 100644 --- a/.github/workflows/scala3-compile.yml +++ b/.github/workflows/scala3-compile.yml @@ -19,7 +19,7 @@ jobs: - akka-testkit/Test/compile akka-actor-tests/Test/compile - akka-actor-testkit-typed/Test/compile akka-actor-typed-tests/Test/compile - akka-bench-jmh/Test/compile - - akka-cluster/Test/compile akka-cluster-tools/Test/compile akka-cluster-typed/Test/compile akka-distributed-data/Test/compile akka-cluster-metrics/Test/compile akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/compile + - akka-cluster/Test/compile akka-cluster-tools/Test/compile akka-cluster-typed/Test/compile akka-distributed-data/Test/compile akka-cluster-metrics/Test/compile akka-cluster-sharding/Test/compile akka-cluster-sharding-typed/Test/compile - akka-discovery/Test/compile akka-coordination/Test/compile - akka-persistence/Test/compile akka-persistence-shared/Test/compile akka-persistence-query/Test/compile akka-persistence-typed/Test/compile akka-persistence-testkit/Test/compile - akka-pki/Test/compile akka-slf4j/Test/compile diff --git a/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala index 2f879b0abf..60ee19b3f5 100644 --- a/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/multi-jvm/scala/akka/cluster/sharding/typed/MultiDcClusterShardingSpec.scala @@ -90,7 +90,7 @@ abstract class MultiDcClusterShardingSpec "be able to ask via entity ref" in { implicit val timeout = Timeout(remainingOrDefault) val entityRef = ClusterSharding(typedSystem).entityRefFor(typeKey, entityId) - val response = entityRef ? Ping + val response = entityRef.ask(Ping.apply) response.futureValue shouldEqual Pong(cluster.selfMember.dataCenter) enterBarrier("ask") } diff --git a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala index 4d97d15d3c..df6a237e1d 100644 --- a/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/akka/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala @@ -269,14 +269,14 @@ class ClusterShardingSpec val bobRef = sharding.entityRefFor(typeKeyWithEnvelopes, "bob") val aliceRef = sharding.entityRefFor(typeKeyWithEnvelopes, "alice") - val reply1 = bobRef ? WhoAreYou - val response = reply1.futureValue + val reply1 = bobRef.ask(WhoAreYou(_)) + val response = reply1.futureValue.asInstanceOf[String] response should startWith("I'm bob") // typekey and entity id encoded in promise ref path response should include(s"${typeKeyWithEnvelopes.name}-bob") - val reply2 = aliceRef.ask(WhoAreYou) - reply2.futureValue should startWith("I'm alice") + val reply2 = aliceRef.ask(WhoAreYou(_)) + reply2.futureValue.asInstanceOf[String] should startWith("I'm alice") bobRef ! StopPlz() } @@ -287,7 +287,7 @@ class ClusterShardingSpec val p = TestProbe[TheReply]() spawn(Behaviors.setup[TheReply] { ctx => - ctx.ask(peterRef, WhoAreYou) { + ctx.ask(peterRef, WhoAreYou.apply) { case Success(name) => TheReply(name) case Failure(ex) => TheReply(ex.getMessage) } @@ -326,7 +326,7 @@ class ClusterShardingSpec val ref = sharding.entityRefFor(ignorantKey, "sloppy") - val reply = ref.ask(WhoAreYou)(Timeout(10.millis)) + val reply = ref.ask(WhoAreYou(_))(Timeout(10.millis)) val exc = reply.failed.futureValue exc.getClass should ===(classOf[AskTimeoutException]) exc.getMessage should startWith("Ask timed out on") diff --git a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala index 748f54bbd4..a757696c47 100644 --- a/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala +++ b/akka-cluster-sharding-typed/src/test/scala/docs/akka/cluster/sharding/typed/AccountExampleSpec.scala @@ -118,9 +118,11 @@ class AccountExampleSpec // Errors are shown in IntelliJ Scala plugin 2019.1.6, but compiles with Scala 2.12.8. // Ok in IntelliJ if using ref.ask[OperationResult]. - ref.askWithStatus(Deposit(100, _)).futureValue should ===(Done) - ref.askWithStatus(Withdraw(10, _)).futureValue should ===(Done) - ref.ask(GetBalance(_)).map(_.balance).futureValue should ===(90) + val deposited = ref.askWithStatus(Deposit(100, _)).futureValue + deposited should ===(Done) + val withdrawn = ref.askWithStatus(Withdraw(10, _)).futureValue + withdrawn should ===(Done) + ref.ask(GetBalance.apply).map(_.balance).futureValue should ===(90) } "verifySerialization" in {