When working with a virtual service (virtual API), you may need to validate requests that the virtual service receives and responses that it sends to clients. To check the virtual service functioning, you can use assertions and scripts.
Verifying Incoming Requests
To validate incoming request data, use assertions. They do not replace the input data validation that your web service should perform, but you can use them to check whether the client code sends appropriate requests to the web service under development. For complete information on creating and using assertions, see Assertions in Virtual Services.
Verifying Virtual Responses
To check whether the virtual service functions properly and returns correct responses, create functional tests that work with your service and check its responses.
For example, create a functional test that will –
Send requests to your virtual service.
Use assertions in this functional test to verify responses of this service.
To learn how to create functional tests, see the tutorial. When creating a test for your virtual service, use the service address for test requests.