DefaultResponseCreator.body(byte[] content)
Set the body as a byte array.
Set the body as a UTF-8 String.
Set the body from a string using the given character set.
DefaultResponseCreator.body(org.springframework.core.io.Resource resource)
Set the body from a Resource
.
DefaultResponseCreator.contentType(org.springframework.http.MediaType mediaType)
Set the Content-Type
header.
DefaultResponseCreator.cookies(org.springframework.http.ResponseCookie... cookies)
DefaultResponseCreator.cookies(org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> multiValueMap)
Copy all cookies from the given MultiValueMap
.
Add a response header with one or more values.
DefaultResponseCreator.headers(org.springframework.http.HttpHeaders headers)
ResponseCreator
for a 202 response (ACCEPTED).
ResponseCreator
for a 502 response (BAD_GATEWAY).
ResponseCreator
for a 400 response (BAD_REQUEST).
ResponseCreator
for a 201 response (CREATED) with a 'Location' header.
ResponseCreator
for a 403 response (FORBIDDEN).
ResponseCreator
for a 504 response (GATEWAY_TIMEOUT).
ResponseCreator
for a 204 response (NO_CONTENT).
ResponseCreator
for a 409 response (CONFLICT).
ResponseCreator
for a 404 response (NOT_FOUND).
ResponseCreator
for a 500 response (SERVER_ERROR).
ResponseCreator
for a 503 response (SERVICE_UNAVAILABLE).
MockRestResponseCreators.withStatus(org.springframework.http.HttpStatusCode status)
ResponseCreator
with a specific HTTP status.
ResponseCreator
for a 200 response (OK).
MockRestResponseCreators.withSuccess(byte[] body,
org.springframework.http.MediaType contentType)
ResponseCreator
for a 200 response (OK) with byte[] body.
MockRestResponseCreators.withSuccess(String body,
org.springframework.http.MediaType contentType)
ResponseCreator
for a 200 response (OK) with String body.
MockRestResponseCreators.withSuccess(org.springframework.core.io.Resource body,
org.springframework.http.MediaType contentType)
ResponseCreator
for a 200 response (OK) content with Resource
-based body.
ResponseCreator
for a 429 ratelimited response (TOO_MANY_REQUESTS).
ResponseCreator
for a 429 rate-limited response (TOO_MANY_REQUESTS)
with a Retry-After
header in seconds.
ResponseCreator
for a 401 response (UNAUTHORIZED).