I have this output
[
{"name": "a"},
{"name": "b"}
]
And the following code
given()
.get("endpoint")
.then()
.body("$.name", hasItem("b"));
But I get this result
java.lang.AssertionError: 1 expectation failed.
JSON path $.name doesn't match.
Expected: (a collection containing "b")
Actual: <[]>
I've tried everything I can think of for path. I'm sure it's something dumb but what am I missing?