From b4953b856b206f7d4052feee2a020d0084683ddb Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Sat, 27 Aug 2022 19:36:43 +0200 Subject: [PATCH] fix test assert returning success in case of decoding error --- .../src/test/scala/github4s/utils/BaseIntegrationSpec.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/github4s/shared/src/test/scala/github4s/utils/BaseIntegrationSpec.scala b/github4s/shared/src/test/scala/github4s/utils/BaseIntegrationSpec.scala index 955d9c3a..e19b408d 100644 --- a/github4s/shared/src/test/scala/github4s/utils/BaseIntegrationSpec.scala +++ b/github4s/shared/src/test/scala/github4s/utils/BaseIntegrationSpec.scala @@ -64,8 +64,9 @@ abstract class BaseIntegrationSpec def testIsRight[A](response: GHResponse[A], f: A => Assertion = (_: A) => succeed): Assertion = { withClue(response.result) { - response.result.toOption map (f(_)) match { - case _ => succeed + response.result match { + case Left(error) => fail(error.getMessage()) + case Right(value) => f(value) } } }