Create Test Collection
The step-by-step guide assumes that you are already familiar with the basics of API Studio:
- Downloaded and installed API Studio
- Downloaded and setup the movieinfo sample service locally
- Familiar with configuring where to send ingress and egress requests
- Running API requests, and saving them to collections
Let us create a service test for the movieinfo service for the MovieInfo sample app.
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
- Configure the destinations for the service under test and egress requests.
- Configure API Studio to send requests from API Studio to the movieinfo service running in your IDE.
- 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.)
- Configure the API Studio proxy to forward egress requests to the Mesh Dynamics services in the cloud.
- 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
- Run all the test requests, and confirm that the responses are correct for each test request.
- For each test request, copy the trace over to the left hand pane by clicking the ‘Set as Reference’ button.
- 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.