DEV Community

mia
mia

Posted on

Switch from live to mock in seconds with Mocker

Today I’ll be talking more about Mocker, our VS Code extension that simplifies service mocking in Kubernetes clusters.

Let’s say you’ve already used Skyramp to deploy your system under test in the cluster, which includes your live payment service. Before Mocker, changing from the live payment service in your cluster to a mock was a complex and time-consuming process. You had to create a new microservice called payment-mock, using the same API spec as the original. This involved writing a server stub to provide the desired response. Then, you had to deploy the mock service into the cluster, and update the networking to disconnect the existing payment microservice. If you wanted to change values, you had to rebuild the microservice and update it accordingly.

Mocker allows you to focus solely on the external configuration, while it takes care of all the internal cluster management through a single worker.

Simply connect your cluster to Mocker.

Image description

Effortlessly modify the return values in your mock configuration.

Image description

Then hit deploy mocks.

Image description

Mocker handles all the heavy lifting behind the scenes, including managing gRPC communications. There’s no Kubernetes expertise required.

That’s it! You’ve switched from live to mock services in just seconds, all within your IDE. Doing it is probably faster than reading about it in this blog!

Coming soon – Tester, the perfect test client complement to Mocker. Tester makes it easy for devs to go beyond unit testing and generate and run complex scenarios for comprehensive services testing. Sign up here to be among the first to hear when we add this new toolkit capability!

Top comments (0)