diff --git a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala index d08b411a8e..964748978a 100644 --- a/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala +++ b/akka-actor-typed-tests/src/test/scala/akka/actor/typed/scaladsl/ActorContextAskSpec.scala @@ -88,8 +88,8 @@ class ActorContextAskSpec extends TestKit(ActorContextAskSpec.config) with Typed val snitch = Behaviors.deferred[AnyRef] { (ctx) ⇒ ctx.ask(pingPong)(Ping) { - // uh oh, missing case for the response, this can never end well - case Failure(x) ⇒ x + case Success(msg) ⇒ throw new NotImplementedError(msg.toString) + case Failure(x) ⇒ x } Behaviors.immutable[AnyRef] { @@ -104,11 +104,11 @@ class ActorContextAskSpec extends TestKit(ActorContextAskSpec.config) with Typed } } - EventFilter[MatchError](occurrences = 1, start = "Success(Pong)").intercept { + EventFilter[NotImplementedError](occurrences = 1, start = "Pong").intercept { spawn(snitch) } - // no-match should cause failure and subsequent stop of actor + // the exception should cause a failure which should stop the actor probe.expectMsg("stopped") }