Smart Assertion - assert logical/relationship contracts in response
Hi,
I have soap response with format similar to the following dummy example,
...
<person>
<firstName>xxxxxxxxxx</firstName>
<lastName>yyyyyyyyyy</lastName>
<phoneNumber>zzzzzzzzzz</phoneNumber>
</person>
...
Important to note is that node person has relation contract one to one.
I have added Smart Assertion and I am asserting if node exists or attribute equals to value and etc.
HOWEVER, we had a bug where this part of the response <person> node was doubled (one to many) and it bugged our system afterwards... and my Smart Assertion was not smart enough to detect that person is one to many instead of one to one.
Is there a way to assert this in ReadyAPI using the provided assertions, let's say the Smart Assertion?
Or perhaps this requirement is strong potential feature for ReadyAPI? Say there is an additional column in Smart Assertion where beside the 'Condition' you can define (optionally) the relation contract for the specific node or attirbute(such as the example above <person> must be one to one).
ili,
your API definition (WSDL in the case of SOAP services) should say there's just one occurrence of the person in the answer in the schema definition (XSD).
Afterward, you can use Schema Compliance assertion.
With this approach, you can validate any issues relating to message structure.
Best regards,
Karel