public abstract class RequestMatchers extends Object
RequestMatcher
classes. Typically used to provide input for
MockRestServiceServer.expect(RequestMatcher)
.Modifier and Type | Method and Description |
---|---|
static RequestMatcher |
anything()
Expects any request.
|
static RequestMatcher |
body(String body)
Expects the given request body content
|
static RequestMatcher |
header(String header,
String value)
Expects the given request header
|
static RequestMatcher |
headerContains(String header,
String substring)
Expects that the specified request header contains a subtring
|
static RequestMatcher |
method(org.springframework.http.HttpMethod method)
Expects the given
HttpMethod . |
static RequestMatcher |
requestTo(String uri)
Expects a request to the given URI.
|
static RequestMatcher |
requestTo(URI uri)
Expects a request to the given URI.
|
public static RequestMatcher anything()
public static RequestMatcher method(org.springframework.http.HttpMethod method)
HttpMethod
.method
- the HTTP methodpublic static RequestMatcher requestTo(String uri)
uri
- the request URIpublic static RequestMatcher requestTo(URI uri)
uri
- the request URIpublic static RequestMatcher header(String header, String value)
header
- the header namevalue
- the header valuepublic static RequestMatcher headerContains(String header, String substring)
header
- the header namesubstring
- the substring that must appear in the headerpublic static RequestMatcher body(String body)
body
- the request bodyCopyright © 2016. All rights reserved.