public static ResponseAwareMatcher<Response> equalToPath(final String path) {
        return response -> equalTo(response.path(path));
    }
public static ResponseAwareMatcher<Response> equalToPath(final String path) {
        return response -> equalTo(response.path(path));
    }
public static ResponseAwareMatcher < Response > equalToPath ( final String path ) { return response -> equalTo ( response . path ( path ) ) ; }
Creates a {@link ResponseAwareMatcher} that extracts the given path from the response and
wraps it in a {@link org.hamcrest.Matchers#equalTo(Object)} matcher. This is useful if you have a resource that e.g. returns the given JSON:
<pre>
{
"userId" : "my-id",
"playerId" : "my-id"
}
</pre>
you can then test it like this:
<pre>
get("/x").then().body("userId", equalToPath("playerId"));
</pre>

@param path The path to check
@return A {@link ResponseAwareMatcher}
Creates a { @link ResponseAwareMatcher } that extracts the given path from the response and wraps it in a { @link org . hamcrest . Matchers#equalTo ( Object ) } matcher . This is useful if you have a resource that e . g . returns the given JSON : <pre > { userId : my - id playerId : my - id } < / pre > you can then test it like this : <pre > get ( / x ) . then () . body ( userId equalToPath ( playerId )) ; < / pre >