About API simulation

API simulation helps you simulate service behavior, so you can continue testing even when real services are unavailable, still under development, or unstable. You can simulate internal systems or third-party services such as APIs, authentication, or credit checks. API simulation lets you build virtual versions that your application interacts with.

What's a simulation?

Simulations are virtual services and connections that stand in for real services that are unavailable in your test environment. A virtual service uses connections to communicate with a service. Each connection points to a destination such as a URL or port, where it sends or receives data.

You can communicate with services using a broad set of message formats and protocols such as HTTP, HTTPS, IBM MQ, Kafka, RabbitMQ, files, and more.

Each simulation contains one or more virtual services. A virtual service tells the simulation how to handle messages. Here are a few things you can do with them:

  • Set up rules so the simulation responds to incoming messages automatically.

  • Send requests and check that the responses match what you expect.

  • Connect multiple services and control the order in which messages flow between them.

How API simulation works

API simulation is tailored to the needs of both testers and developers. You can create simulations directly in Tosca Cloud or write them as YAML files in an Integrated Development Environment (IDE). If you already use Tosca OSV, you can also migrate your simulations to API simulation.

In Tosca Cloud, you can view all your simulations and see which Simulator agent they're deployed to.

You can deploy simulations from Tosca Cloud to any Simulator agent on any machine and run them there.

The Simulator agent hosts simulations that you can run in your local environment on any machine. These simulations send messages, receive requests, or respond like real services.

This video shows you how API simulation works.

What's next

Now that you know what API simulation can do, here's where to go next: