Using auto-created mocks

Updated 1 week ago by Rahul Lahiri

In the previous step, you used live services in the dev cluster to serve the egress requests from the service in the IDE. Sometimes the services in the dev cluster may not be available, either due to a buggy version of the service in the dev cluster, or the cluster being down. API Studio makes it simple to switch to using mocks auto-created from earlier usage.

Mocks auto-created from earlier requests

You ran the requests against the live services in the previous step. API Studio has the data required to mock those external services, and those mocks have been automatically generated. We are going to change the configuration of egress requests to use mocks instead of the live cluster.

  1. Change egress service configuration to use the auto-created mocks. Click on the proxy settings dropdown and select the All services mocked configuration.
  1. Now run the request again. You will see that the request succeeds. You will also notice the indicators for whether the mock match was exact or approximate next to every egress request that was sent to the mocks services.

Next steps

So far we have covered use cases where the upstream services are available in the dev cluster, even if there are bugs in the current deployed version. Next, we will go over an example of how API Studio supports parallel development of services with dependencies that is common to microservices development.


How did we do?