Should compare json response in Equals mode
Given there is resource at
/hello
And it responds with body
{
"greeting": "Hello",
"who": "World"
}
When following fixture is executed:
Formatting does not matter |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="equals">
{"greeting": "Hello","who": "World"}
</rest:jsonResponse>
</rest:request>
|
Success
|
Property order does not matter |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="equals">
{
"who": "World",
"greeting": "Hello"
}
</rest:jsonResponse>
</rest:request>
|
Success
|
Should compare json response in Includes mode
Given there is resource at
/hello
And it responds with body
{
"greeting": "Hello",
"who": {
"prefix": "Another",
"name": "World"
},
"from": ["Alice", "Bob"]
}
When following fixture is executed:
Additional properties in actual do not matter |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="includes">
{
"greeting": "Hello"
}
</rest:jsonResponse>
</rest:request>
|
Success
|
Nested properties do matter (1) |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="includes">
{
"who": {
"name": "World"
}
}
</rest:jsonResponse>
</rest:request>
|
Success
|
Nested properties do matter (2) |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="includes">
{
"who": {
"name": "You"
}
}
</rest:jsonResponse>
</rest:request>
|
Failure
|
Collections order does not matter (1) |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="includes">
{
"from": ["Alice", "Bob"]
}
</rest:jsonResponse>
</rest:request>
|
Success
|
Collections order does not matter (2) |
<rest:request>
<rest:get>/hello</rest:get>
<rest:jsonResponse mode="includes">
{
"from": ["Bob", "Alice"]
}
</rest:jsonResponse>
</rest:request>
|
Failure
|