public abstract class RestDocumentationRequestBuilders extends Object
MockMvcRequestBuilders that captures a request's URL
template and makes it available for documentation. Required when
) documenting path parameters and recommended for general usage.MockMvcRequestBuilders,
RequestDocumentation.pathParameters(org.springframework.restdocs.request.ParameterDescriptor...),
RequestDocumentation.pathParameters(java.util.Map,
org.springframework.restdocs.request.ParameterDescriptor...)| Modifier and Type | Method and Description |
|---|---|
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
delete(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a DELETE request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
delete(URI uri)
Create a
MockHttpServletRequestBuilder for a DELETE request. |
static org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder |
fileUpload(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a multipart request. |
static org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder |
fileUpload(URI uri)
Create a
MockHttpServletRequestBuilder for a multipart request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
get(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a GET request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
get(URI uri)
Create a
MockHttpServletRequestBuilder for a GET request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
head(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a HEAD request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
head(URI uri)
Create a
MockHttpServletRequestBuilder for a HEAD request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
options(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for an OPTIONS request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
options(URI uri)
Create a
MockHttpServletRequestBuilder for an OPTIONS request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
patch(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a PATCH request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
patch(URI uri)
Create a
MockHttpServletRequestBuilder for a PATCH request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
post(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a POST request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
post(URI uri)
Create a
MockHttpServletRequestBuilder for a POST request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
put(String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a PUT request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
put(URI uri)
Create a
MockHttpServletRequestBuilder for a PUT request. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
request(org.springframework.http.HttpMethod httpMethod,
String urlTemplate,
Object... urlVariables)
Create a
MockHttpServletRequestBuilder for a request with the given HTTP
method. |
static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder |
request(org.springframework.http.HttpMethod httpMethod,
URI uri)
Create a
MockHttpServletRequestBuilder for a request with the given HTTP
method. |
public static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder get(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a GET request. The url template
will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder get(URI uri)
MockHttpServletRequestBuilder for a GET request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder post(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a POST request. The url template
will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder post(URI uri)
MockHttpServletRequestBuilder for a POST request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder put(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a PUT request. The url template
will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder put(URI uri)
MockHttpServletRequestBuilder for a PUT request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder patch(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a PATCH request. The url
template will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder patch(URI uri)
MockHttpServletRequestBuilder for a PATCH request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder delete(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a DELETE request. The url
template will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder delete(URI uri)
MockHttpServletRequestBuilder for a DELETE request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder options(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for an OPTIONS request. The url
template will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder options(URI uri)
MockHttpServletRequestBuilder for an OPTIONS request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder head(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a HEAD request. The url template
will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder head(URI uri)
MockHttpServletRequestBuilder for a HEAD request.uri - the URLpublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder request(org.springframework.http.HttpMethod httpMethod,
String urlTemplate,
Object... urlVariables)
MockHttpServletRequestBuilder for a request with the given HTTP
method. The url template will be captured and made available for documentation.httpMethod - the HTTP methodurlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder request(org.springframework.http.HttpMethod httpMethod,
URI uri)
MockHttpServletRequestBuilder for a request with the given HTTP
method.httpMethod - the HTTP method (GET, POST, etc)uri - the URLpublic static org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder fileUpload(String urlTemplate, Object... urlVariables)
MockHttpServletRequestBuilder for a multipart request. The url
template will be captured and made available for documentation.urlTemplate - a URL template; the resulting URL will be encodedurlVariables - zero or more URL variablespublic static org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder fileUpload(URI uri)
MockHttpServletRequestBuilder for a multipart request.uri - the URL