Package | Description |
---|---|
org.springframework.test.web.client |
Contains client-side REST testing support.
|
org.springframework.test.web.client.match |
Contains built-in
RequestMatcher
implementations. |
Modifier and Type | Method and Description |
---|---|
ResponseActions |
ResponseActions.andExpect(RequestMatcher requestMatcher)
Add a request expectation.
|
ResponseActions |
MockRestServiceServer.expect(RequestMatcher requestMatcher)
Set up a new HTTP request expectation.
|
Modifier and Type | Method and Description |
---|---|
static RequestMatcher |
MockRestRequestMatchers.anything()
Match to any request.
|
<T> RequestMatcher |
XpathRequestMatchers.booleanValue(Boolean value)
Apply the XPath and assert the boolean value found.
|
RequestMatcher |
ContentRequestMatchers.bytes(byte[] expectedContent)
Compare the body of the request to the given byte array.
|
RequestMatcher |
ContentRequestMatchers.contentType(MediaType expectedContentType)
Assert the request content type as a
MediaType . |
RequestMatcher |
ContentRequestMatchers.contentType(String expectedContentType)
Assert the request content type as a String.
|
RequestMatcher |
ContentRequestMatchers.contentTypeCompatibleWith(MediaType contentType)
Assert the request content type is compatible with the given
content type as defined by
MediaType.isCompatibleWith(MediaType) . |
RequestMatcher |
ContentRequestMatchers.contentTypeCompatibleWith(String contentType)
Assert the request content type is compatible with the given
content type as defined by
MediaType.isCompatibleWith(MediaType) . |
RequestMatcher |
JsonPathRequestMatchers.doesNotExist()
Evaluate the JSON path and assert the resulting content exists.
|
<T> RequestMatcher |
XpathRequestMatchers.doesNotExist()
Assert that content does not exist at the given XPath.
|
RequestMatcher |
JsonPathRequestMatchers.exists()
Apply the JSONPath and assert the resulting value.
|
<T> RequestMatcher |
XpathRequestMatchers.exists()
Assert that content exists at the given XPath.
|
static RequestMatcher |
MockRestRequestMatchers.header(String name,
org.hamcrest.Matcher<? super String>... matchers)
Assert request header values with the given Hamcrest matcher.
|
static RequestMatcher |
MockRestRequestMatchers.header(String name,
String... expectedValues)
Assert request header values.
|
RequestMatcher |
JsonPathRequestMatchers.isArray()
Assert the content at the given JSONPath is an array.
|
static <T> RequestMatcher |
MockRestRequestMatchers.jsonPath(String expression,
org.hamcrest.Matcher<T> matcher)
Access to request body matchers using a JSONPath expression to
inspect a specific subset of the body and a Hamcrest match for asserting
the value found at the JSON path.
|
static RequestMatcher |
MockRestRequestMatchers.method(HttpMethod method)
Assert the
HttpMethod of the request. |
RequestMatcher |
ContentRequestMatchers.node(org.hamcrest.Matcher<? super Node> matcher)
Parse the request content as
Node and apply the given Matcher . |
<T> RequestMatcher |
XpathRequestMatchers.node(org.hamcrest.Matcher<? super Node> matcher)
Apply the XPath and assert it with the given
Matcher<Node> . |
<T> RequestMatcher |
XpathRequestMatchers.nodeCount(int expectedCount)
Apply the XPath and assert the number of nodes found.
|
<T> RequestMatcher |
XpathRequestMatchers.nodeCount(org.hamcrest.Matcher<Integer> matcher)
Apply the XPath and assert the number of nodes found with the given
Matcher<Integer> . |
RequestMatcher |
XpathRequestMatchers.number(Double value)
Apply the XPath and assert the number of nodes found.
|
<T> RequestMatcher |
XpathRequestMatchers.number(org.hamcrest.Matcher<? super Double> matcher)
Apply the XPath and assert the number found with the given matcher.
|
static RequestMatcher |
MockRestRequestMatchers.requestTo(org.hamcrest.Matcher<String> matcher)
Assert the request URI string with the given matcher.
|
static RequestMatcher |
MockRestRequestMatchers.requestTo(String expectedUri)
Assert the request URI string.
|
static RequestMatcher |
MockRestRequestMatchers.requestTo(URI uri)
Expect a request to the given URI.
|
RequestMatcher |
ContentRequestMatchers.source(org.hamcrest.Matcher<? super Source> matcher)
Parse the request content as
DOMSource and apply the given Matcher . |
RequestMatcher |
ContentRequestMatchers.string(org.hamcrest.Matcher<? super String> matcher)
Get the body of the request as a UTF-8 string and appply the given
Matcher . |
<T> RequestMatcher |
XpathRequestMatchers.string(org.hamcrest.Matcher<? super String> matcher)
Apply the XPath and assert the String content found with the given matcher.
|
RequestMatcher |
ContentRequestMatchers.string(String expectedContent)
Get the body of the request as a UTF-8 string and compare it to the given String.
|
RequestMatcher |
XpathRequestMatchers.string(String value)
Apply the XPath and assert the String content found.
|
<T> RequestMatcher |
JsonPathRequestMatchers.value(org.hamcrest.Matcher<T> matcher)
Evaluate the JSONPath and assert the resulting value with the given
Matcher . |
RequestMatcher |
JsonPathRequestMatchers.value(Object expectedValue)
Apply the JSONPath and assert the resulting value.
|
RequestMatcher |
ContentRequestMatchers.xml(String expectedXmlContent)
Parse the request body and the given String as XML and assert that the
two are "similar" - i.e.
|
Copyright © 2015. All rights reserved.