modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/matcher/RestAssuredMockMvcMatchers.java
public static ResponseAwareMatcher<MockMvcResponse> startsWithPath(final String path) {
        return new ResponseAwareMatcher<MockMvcResponse>() {
            public Matcher<?> matcher(MockMvcResponse response) {
                return startsWith(response.<String>path(path));
            }
        };
    }
public static ResponseAwareMatcher<MockMvcResponse> startsWithPath(final String path) {
        return new ResponseAwareMatcher<MockMvcResponse>() {
            public Matcher<?> matcher(MockMvcResponse response) {
                return startsWith(response.<String>path(path));
            }
        };
    }
public static ResponseAwareMatcher < MockMvcResponse > startsWithPath ( final String path ) { return new ResponseAwareMatcher < MockMvcResponse > ( ) { public Matcher < ? > matcher ( MockMvcResponse response ) { return startsWith ( response . < String > 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",
"baseUri" : "http://localhost:8080",
"href" : "http://localhost:8080/my-id"
}
</pre>
you can then test it like this:
<pre>
get("/x").then().body("href", startsWithPath("baseUri"));
</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 baseUri : http : // localhost : 8080 href : http : // localhost : 8080 / my - id } < / pre > you can then test it like this : <pre > get ( / x ) . then () . body ( href startsWithPath ( baseUri )) ; < / pre >