From c1e05229705ae2a67e164c0b6ee288e4d9a981dd Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 25 Jan 2018 15:22:11 +0100 Subject: [PATCH] Suppress 'match is not exhaustive!' warning (#24408) * Suppress 'match is not exhaustive!' warning Not super clean, but gets rid of the compiler warning shown every time this file is compiled. * Using a NotImplementedError rather than a MatchError --- .../akka/actor/typed/scaladsl/ActorContextAskSpec.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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") }