This is my JSON :
[
{
"id": 9741962,
"name": "getName",
"isActive": true
},
{
"id": 1,
"name": "New",
"isActive": true
}
]
I want to get all the object that has the name :getName using jsonPath how can I do it using JsonPath (the onw that comes with rest assured)
I try this one
JsonPath.with(jsonResponse).get("findAll { a -> a.name == getName }");
but I am getting Error.
java.lang.IllegalArgumentException: No such property: sdfsdf for class: Script1
Thanks.
OK I found it, needed to add apostrophes.
JsonPath.with(jsonResponse).get("findAll { a -> a.name == 'getName' }");