Use API Studio to Mock gRPC service

Updated 1 month ago by Rahul Lahiri

We now show how we can mock the egress request from the trace that we created earlier for the Route-Guider service. We will reuse the data from running the request previously. Thus, mocks will be auto-created by MeshD.

  • Open the proxy config setting (the gear icon near the top – the second from the right). Click the mock checkbox so it will mock and “update” before closing the config

  • Set the original request as reference.

  • Run the request now and compare. You may have to save the request to a collection before we can do a Diff.  Notice the egress request has an orange bar next to it indicating that the request is being mocked.

Next

You can use these API traces for creating service tests -- either to be run locally on your laptop or in the CI pipelines. Please see the Service Testing section for more details.


How did we do?