How to use WireMock to mock an upstream service with Protobuf (gRPC) response

Viewed 1633

I am writing integration tests for my Java Service. We are thinking of using WireMock to mock upstream services. However, one of our upstream returns a Protobuf (grpc) response and I can't seem to understand how to mock a gRPC response using WireMock. I tried to convert the response to byteArray and use that ,however, wiremock fails to deserialize it to Protobuf Java Object.

We have a limitation that we can only use 1 mock server since all our upstream requests are forwarded via a servicemesh sidecar running on a fixed port.

Thanks!

1 Answers
Related