public class RestAssuredMockMvcMatchers extends Object
| Constructor and Description | 
|---|
| RestAssuredMockMvcMatchers() | 
| Modifier and Type | Method and Description | 
|---|---|
| static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> | containsPath(String path)Creates a  ResponseAwareMatcherthat extracts the given path from the response and
 wraps it in aMatchers.equalTo(Object)matcher. | 
| static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> | endsWithPath(String path)Creates a  ResponseAwareMatcherthat extracts the given path from the response and
 wraps it in aMatchers.equalTo(Object)matcher. | 
| static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> | equalToPath(String path)Creates a  ResponseAwareMatcherthat extracts the given path from the response and
 wraps it in aMatchers.equalTo(Object)matcher. | 
| static org.hamcrest.Matcher<String> | matchesDtd(File dtd)Evaluates to true if an XML string matches the supplied DTD. | 
| static org.hamcrest.Matcher<String> | matchesDtd(InputStream dtd)Evaluates to true if an XML string matches the supplied DTD. | 
| static org.hamcrest.Matcher<String> | matchesDtd(String dtd)Evaluates to true if an XML string matches the supplied DTD. | 
| static org.hamcrest.Matcher<String> | matchesDtd(URL url)Evaluates to true if an XML string matches the supplied DTD. | 
| static org.hamcrest.Matcher<String> | matchesDtdInClasspath(String path)Evaluates to true if an XML file in classpath matches the supplied DTD. | 
| static org.hamcrest.Matcher<String> | matchesXsd(File xsd)Evaluates to true if an XML string matches the supplied XSD (Xml Schema). | 
| static org.hamcrest.Matcher<String> | matchesXsd(InputStream xsd)Evaluates to true if an XML string matches the supplied XSD (Xml Schema). | 
| static org.hamcrest.Matcher<String> | matchesXsd(Reader xsd)Evaluates to true if an XML string matches the supplied XSD (Xml Schema). | 
| static org.hamcrest.Matcher<String> | matchesXsd(String xsd)Evaluates to true if an XML string matches the supplied XSD (Xml Schema). | 
| static org.hamcrest.Matcher<String> | matchesXsdInClasspath(String path)Evaluates to true if an XML file in classpath matches the supplied XSD. | 
| static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> | startsWithPath(String path)Creates a  ResponseAwareMatcherthat extracts the given path from the response and
 wraps it in aMatchers.equalTo(Object)matcher. | 
public static org.hamcrest.Matcher<String> matchesXsd(String xsd)
xsd - The XSD to matchpublic static org.hamcrest.Matcher<String> matchesXsd(InputStream xsd)
xsd - The XSD to matchpublic static org.hamcrest.Matcher<String> matchesXsd(Reader xsd)
xsd - The XSD to matchpublic static org.hamcrest.Matcher<String> matchesXsd(File xsd)
xsd - The XSD to matchpublic static org.hamcrest.Matcher<String> matchesXsdInClasspath(String path)
path - The path to the XSD located in classpathpublic static org.hamcrest.Matcher<String> matchesDtd(String dtd)
dtd - The DTD to matchpublic static org.hamcrest.Matcher<String> matchesDtd(InputStream dtd)
dtd - The DTD to matchpublic static org.hamcrest.Matcher<String> matchesDtd(File dtd)
dtd - The DTD to matchpublic static org.hamcrest.Matcher<String> matchesDtd(URL url)
url - The DTD to matchpublic static org.hamcrest.Matcher<String> matchesDtdInClasspath(String path)
path - The path to the DTD file in classpathpublic static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> equalToPath(String path)
ResponseAwareMatcher that extracts the given path from the response and
 wraps it in a Matchers.equalTo(Object) matcher. This is useful if you have a resource that e.g. returns the given JSON:
 
 {
      "userId" : "my-id",
      "playerId" : "my-id"
 }
 
 you can then test it like this:
 
 get("/x").then().body("userId", equalToPath("playerId"));
 path - The path to checkResponseAwareMatcherpublic static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> endsWithPath(String path)
ResponseAwareMatcher that extracts the given path from the response and
 wraps it in a Matchers.equalTo(Object) matcher. This is useful if you have a resource that e.g. returns the given JSON:
 
 {
      "userId" : "my-id",
      "href" : "http://localhost:8080/my-id"
 }
 
 you can then test it like this:
 
 get("/x").then().body("href", endsWithPath("userId"));
 path - The path to checkResponseAwareMatcherpublic static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> startsWithPath(String path)
ResponseAwareMatcher that extracts the given path from the response and
 wraps it in a Matchers.equalTo(Object) matcher. This is useful if you have a resource that e.g. returns the given JSON:
 
 {
      "userId" : "my-id",
      "baseUri" : "http://localhost:8080",
      "href" : "http://localhost:8080/my-id"
 }
 
 you can then test it like this:
 
 get("/x").then().body("href", startsWithPath("baseUri"));
 path - The path to checkResponseAwareMatcherpublic static io.restassured.matcher.ResponseAwareMatcher<MockMvcResponse> containsPath(String path)
ResponseAwareMatcher that extracts the given path from the response and
 wraps it in a Matchers.equalTo(Object) matcher. This is useful if you have a resource that e.g. returns the given JSON:
 
 {
      "userId" : "my-id",
      "href" : "http://localhost:8080/my-id"
 }
 
 you can then test it like this:
 
 get("/x").then().body("href", containsPath("userId"));
 path - The path to checkResponseAwareMatcherCopyright © 2010–2025. All rights reserved.