Unable to Access Sample Test Data from OpenAPI (Swagger 2.0) Created SVs

Document ID : KB000074457
Last Modified Date : 21/03/2018
Show Technical Document Details
Introduction:
When a VS is created using Swagger Specification in DevTest Portal, it shows the sample request and responses which can be used for testing later. Sometimes the VS gives a 404 No Match instead of the Meta response.

For example:
Created a VS using Swagger specification in DevTest Portal and it created 3 stateless transactions for GET /images/test/assignment/{id} (Default JSON DPH was selected). After the VS is created, changed the {id} to 123, 234, 456 in 3 transactions. 

When testing the VS by sending 3 transactions using the values 123/234/456 and get a valid response. When a different value other than 123/234/456 is used VS will give a "No Match" because the VSI doesn't have any stateless transaction with the other value (by design). 

How do get a Meta response instead of "No Match"?


 
Question:
How to use the test data from the recording and get a valid response?
Environment:
Devtest 10.x versions
Answer:
Create a VS and select REST DPH and then JSON DPH in the Request side Data Protocols will resolve the issue.

With REST DPH and then JSON DPH, VS creates one Stateless transaction "GET /images/test/assignment/{URLPARAM0}" with 3 Specific transactions instead of 3 stateless transactions. Then the 3 specific transactions can be changed to have 123/234/456 for {URLPARAM0}. When a new value is sent then VS will return a META response instead of "No Match" response.
 
Additional Information:
. https://docops.ca.com/devtest-solutions/10-1/en/using/using-ca-service-virtualization/using-devtest-portal-with-ca-service-virtualization/rest-data-protocol-handler
. https://docops.ca.com/devtest-solutions/10-1/en/using/using-ca-service-virtualization/using-devtest-workstation-with-ca-service-virtualization/creating-service-images/using-data-protocols/json-data-protocol