February 2015
Intermediate to advanced
328 pages
7h 29m
English
Do you have REST responses that you'd like to validate against a JSON schema? This recipe shows a simple way to do this using a Groovy TestStep.
First, we're going to need a simple test project with a mock that produces some sample JSON responses for us to validate. A ready-made project invoice-rest-json-schema-soapui-project.xml has been provided to do this in the chapter 4 samples. It contains a simple REST project with one resource GET /invoice/{id}, a mock with two sample responses, and a test case with REST TestRequest and Groovy TestSteps. The invoice document is the usual example; that is:
{"invoice": {
"id": 12345,
"companyName": "Test Company",
"amount": 100
}}We'll also need a ...
Read now
Unlock full access