Skip to content

How does compatibility work?

Chris James edited this page May 22, 2015 · 4 revisions

Mockingjay will check easy things such as status codes, URLs and headers to see if they match. If you define you want a particular header and it isn't in the response, then it will fail. What's more interesting is how response bodies are checked

If it detects it should be JSON...

It uses jsonequaliser to check compatibility, rather than just a straight string match as that tends to create false negatives.

What this does is look for "evidence" that two JSON strings are compatible. If JSON A has a field called "name" which has a string value, then JSON B has to have that field and any string.

It checks types and checks the whole structure it gets (i.e nested). For arrays, if JSON A has an array of 3 "things", then JSON B must have at least one element in an array with the same structure

If it detects XML

The same as above.