From e63239e3372a2f696170fb0514acea53a10e5b5d Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 26 Apr 2017 17:05:12 +0200 Subject: [PATCH] Stop adapted actorsystem after running TypedSpec (#22763) --- .../src/test/scala/akka/typed/TypedSpec.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/akka-typed-tests/src/test/scala/akka/typed/TypedSpec.scala b/akka-typed-tests/src/test/scala/akka/typed/TypedSpec.scala index a0e52febdb..aff7c3435a 100644 --- a/akka-typed-tests/src/test/scala/akka/typed/TypedSpec.scala +++ b/akka-typed-tests/src/test/scala/akka/typed/TypedSpec.scala @@ -57,7 +57,7 @@ abstract class TypedSpec(val config: Config) extends TypedSpecSetup { private var adaptedSystemUsed = false lazy val adaptedSystem: ActorSystem[TypedSpec.Command] = { val sys = ActorSystem.adapter(AkkaSpec.getCallerName(classOf[TypedSpec]), guardian(), config = Some(config withFallback AkkaSpec.testConf)) - adaptedSystemUsed = false + adaptedSystemUsed = true sys } @@ -202,13 +202,15 @@ class TypedSpecSpec extends TypedSpec { object `A TypedSpec` { trait CommonTests { + class MyException(message: String) extends Exception(message) + implicit def system: ActorSystem[TypedSpec.Command] def `must report failures`(): Unit = { - a[TestFailedException] must be thrownBy { + a[MyException] must be thrownBy { sync(runTest("failure")(StepWise[String]((ctx, startWith) ⇒ startWith { - fail("expected") + throw new MyException("expected") }))) } }