Create Test Collection

Updated 3 months ago by Rahul Lahiri

The step-by-step guide assumes that you are already familiar with the basics of API Studio:

Let us create a service test for the movieinfo service for the MovieInfo sample app.

Overview

The process of creating test collections involves the following steps:

  • Configuring the service in the IDE to send egress requests back to API Studio
  • Configuring API Studio to forward the egress requests to the producer services
  • Creating test requests in the API editor
  • Sending the requests to the service running in your IDE
  • Creating a collection with the API traces

Create test collection

  1. Configure the destinations for the service under test and egress requests.
    1. Configure API Studio to send requests from API Studio to the movieinfo service running in your IDE.
    2. Configure movieinfo code to send egress requests to the API Studio proxy (in the file BookInfo.java. This should already be configured in the downloaded file.)
    3. Configure the API Studio proxy to forward egress requests to the Mesh Dynamics services in the cloud.
  2. Next, create a set of requests to test the movieinfo service. This includes creating API requests for each API you want to test, running the requests to generate responses, and validating the responses. Mesh Dynamics automatically creates mocks for the producer services during this process.
    A comprehensive service test can be quite deep. For this tutorial, let's use just one example request for each API of the movieinfo service.
  • listmovies API
  • liststores API
  • rentmovie API
  1. Run all the test requests, and confirm that the responses are correct for each test request.
  1. For each test request, copy the trace over to the left hand pane by clicking the ‘Set as Reference’ button.
  1. Save all the test requests to a collection. Let's name the collection movieinfo-service-test.
    Note that the requests must be added to the collection individually. We do not have a batch operation to save multiple selected requests.

In the next step, we will convert the collection to a test and add decision rules.


How did we do?