I have REST for finding users by name, which for some search term returns users that has that term in first name or last name.
GET /search/joe
returns json array:
[
{"id": 1, "firstName": "Joe", "lastName": "Doe"},
{"id": 2, "firstName": "Alex", "lastName": "Joelson"}
]
How to test this REST with restassured and verify that given search term is contained in either first or last name of every row, case insensitive?
given()
.when()
.get("/user/search")
.then()
.statusCode(200)
.body(?)