Merge pull request #30562 from marcospereira/issues/30552/debug-message-adapter-spec

Clearer error message when the test fails
This commit is contained in:
Marcos Pereira 2021-08-24 15:26:05 -04:00 committed by GitHub
commit 53ea3685dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,7 +244,7 @@ class MessageAdapterSpec
.receiveMessage[Wrapped] { _ =>
probe.ref ! count
if (count == 3) {
throw new TestException("boom")
throw TestException("boom")
}
behv(count + 1)
}
@ -294,7 +294,12 @@ class MessageAdapterSpec
deadLetter.message match {
case AdaptMessage(Pong("hi"), _) => // passed through the FunctionRef
case Pong("hi") => // FunctionRef stopped
case unexpected => fail(s"Unexpected message [$unexpected], expected Pong or AdaptMessage(Pong)")
case unexpected =>
fail(s"""
|Unexpected message:
|Got => $unexpected: ${unexpected.getClass.getName}
|Expected => ${classOf[Pong].getName} or AdaptMessage(${classOf[Pong].getName})
|""".stripMargin)
}
}