LukeMathWalker / wiremock-rs

HTTP mocking to test Rust applications.
Apache License 2.0
617 stars 70 forks source link

GRPC support #86

Closed marlon-sousa closed 2 years ago

marlon-sousa commented 2 years ago

Hello,

I have a question for which I didn't find a answer.

How easy would it be to support GRPC mocking on wiremock-rs?

The api would be the same:

  1. You start a server.
  2. You provide stubs for requests, by specifing service name / method / request message (or matchers)
  3. You provide a suitable response on match.
  4. You provide a way of investigating if a call was performed to this stub on this server.

I have been searching for crates which allow this kind of thing because it would enable easy integration testing of microservices which have to call grpc end points as part of their execution flow.

Using grip mock strategy, which is to translate grpc message to JSON, call wiremock, get response and translate that to GRPC again appears to be a good idea. Never the less as I am not really fammiliar with all of that I thought asking here would be a good idea.

Do you think something like this could be implemented?

Thanks, Marlon

LukeMathWalker commented 2 years ago

It's unfortunately fairly complicated - I explored the idea a while ago and I didn't manage to build an ergonomic API. It is out of scope for wiremock for the foreseeable future.