Sometimes GET call is returning [] empty array. I can use .body(size), but I do not want to use hard assertions.
It can be empty or have an array of objects, so I want to use if condition to make a decision to proceed further based on empty/not empty.
The code is as below:
given().when().get(url).then().body("[0].name",equalTo(value))
Any help would be appreciated.