I would like to compare if two jsonPath value are equal like this:
this.mockMvc.perform(get(requestURL)).andExpect(jsonPath("$.prop1", equalTo(jsonPath("$.prop2"))));
but then my test was failed. The jsonPath("$.prop1") returned the correct value I want, but jsonPath("$.prop2") returned not the value of this property, instead the classname like:
org.springframework.test.web.servlet.result.JsonPathResultMatchers@7b7aaaf6
Can anyone give me idea how can I perform the toString() method for the jsonPath()? I did try also jsonPath("$.prop2").toString() but also received the classname.
Thank you in advanced!