Skip to content

Commit

Permalink
fix: compile on scala3
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed Sep 20, 2023
1 parent bf6d026 commit b10e545
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class AskSpec extends ScalaTestWithActorTestKit("""

"Ask pattern" must {
"fail the future and publish deadletter with recipient if the actor is already terminated" in {
import pekko.actor.typed.internal.adapter.ActorRefAdapter._

val ref = spawn(behavior)
val stopResult: Future[Unit] = ref.ask(Stop.apply)
stopResult.futureValue
Expand All @@ -70,6 +72,7 @@ class AskSpec extends ScalaTestWithActorTestKit("""
result shouldBe a[TimeoutException]
result.getMessage should include("had already been terminated.")

val deadLetterProbe = createDeadLetterProbe()
val deadLetter = deadLetterProbe.receiveMessage()
deadLetter.message match {
case Foo(s, _) => s should ===("bar")
Expand All @@ -78,7 +81,7 @@ class AskSpec extends ScalaTestWithActorTestKit("""

val deadLettersRef = system.classicSystem.deadLetters
deadLetter.recipient shouldNot equal(deadLettersRef)
deadLetter.recipient should equal(ActorRefAdapter.toClassic(actor))
deadLetter.recipient should equal(toClassic(ref))
}

"succeed when the actor is alive" in {
Expand Down

0 comments on commit b10e545

Please sign in to comment.