Skip to content

Commit

Permalink
improve: apply suggestions from code review
Browse files Browse the repository at this point in the history
grpc content type could be application/grpc+{proto, json, etc.}
  • Loading branch information
i10416 committed Nov 13, 2024
1 parent f59040e commit cb7d8d7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,18 @@ class TestServiceSuite extends CatsEffectSuite with ScalaCheckEffectSuite {
val client = Client.fromHttpApp(TestService.toRoutes(impl).orNotFound)
implicit val methodExceptPost: Arbitrary[Method] =
Arbitrary(Gen.oneOf(Method.all.filterNot(_ === Method.POST)))
forAllF { (meth: Method) =>
implicit val wellKnownGRPCHeaders: Arbitrary[Header.ToRaw] = Arbitrary(
Gen.oneOf(
"Content-Type" -> "application/grpc",
"Content-Type" -> "application/grpc+proto",
"Content-Type" -> "application/grpc+json",
)
)
forAllF { (meth: Method, grpcHeader: Header.ToRaw) =>
client
.run(
Request[IO](meth, uri"/hello.world.TestService/any/url")
.withHeaders("Content-Type" -> "application/grpc")
.withHeaders(grpcHeader)
)
.use { resp =>
val headers = resp.headers
Expand Down

0 comments on commit cb7d8d7

Please sign in to comment.