From a49dddf3305a137e09ca2b453afb781024c3d2a3 Mon Sep 17 00:00:00 2001 From: dinojohn Date: Wed, 9 Feb 2022 17:34:29 +0530 Subject: [PATCH] Use a Gen of methods without HEAD for Responses with content --- .../src/test/scala/zhttp/service/ServerSpec.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zio-http/src/test/scala/zhttp/service/ServerSpec.scala b/zio-http/src/test/scala/zhttp/service/ServerSpec.scala index fa0f506fbc..13d77b7170 100644 --- a/zio-http/src/test/scala/zhttp/service/ServerSpec.scala +++ b/zio-http/src/test/scala/zhttp/service/ServerSpec.scala @@ -280,7 +280,19 @@ object ServerSpec extends HttpRunnableSpec { } } + testM("500 response") { - checkAllM(HttpGen.method) { method => + val methodGenWithoutHEAD: Gen[Any, Method] = Gen.fromIterable( + List( + Method.OPTIONS, + Method.GET, + Method.POST, + Method.PUT, + Method.PATCH, + Method.DELETE, + Method.TRACE, + Method.CONNECT, + ), + ) + checkAllM(methodGenWithoutHEAD) { method => val actual = status(method, !! / "HExitFailure") assertM(actual)(equalTo(Status.INTERNAL_SERVER_ERROR)) }