I'm trying to make a test validating one json using JsonPath, I could create the test, but when I validate what I got is probably a type error Expected: <[4]> but: was <[4]>
my test is this:
mockmvc.perform(get("/client/rating"))
.andExpect(status().isOk())
.andExpect(jsonPath("$", hasSize(3)))
.andExpect(jsonPath("$[?(@.id == prod1)].rate", equalTo(new JSONArray("[4]"))));
I don't have the Json tested here, but the value is right, the only problem is its type...
I appreciate any help!
you can do this test this way: