How to test whether grpc end points have been called in integration tests

Hello,

I am investigating testing strategies for microservices in rust.

The microservices I am writing will often, as part of their processing, call other microservices using grpc.

Sometimes responses of these called microservices are important (synchronous execution), some times not (inner grpc service is called as a form of notification).

Anyways, in order to test if functionality of my service is working, I need:

  1. Check if a given grpc end point has been called.
  2. Provide a mocked response on given grpc endpoint.

There are two crates which helpp a lot with these goals if you're using rest to perform calls, but I haven't been able to find similar solutions when it comes to GRPC.

Some of these services also use messaging, but how to assert a message has been sent to a exchange is something I will open up a new question for im some time.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.