Json body:
{
"result": [
{
"object": {
"type": "mattress"
}
},
{
"object": {
"type": "pillow"
}
}
]
}
How do I assert that type is only either pillow or a mattress (there can be more so I am looking for a generic solution) using rest-assured body and hamcrest assertions?
Example assertion:
response.then().assertThat().body("result", hasSize(greaterThan(0)));