Uses of Class
org.springframework.test.web.client.response.DefaultResponseCreator
-
Uses of DefaultResponseCreator in org.springframework.test.web.client.response
Modifier and TypeMethodDescriptionDefaultResponseCreator.body
(byte[] content) Set the body as a byte array.Set the body as a UTF-8 String.Set the body as aResource
.DefaultResponseCreator.contentType
(MediaType mediaType) Set theContent-Type
header.DefaultResponseCreator.headers
(HttpHeaders headers) Copy all given headers.Set theLocation
header.static DefaultResponseCreator
MockRestResponseCreators.withBadRequest()
ResponseCreator
for a 400 response (BAD_REQUEST).static DefaultResponseCreator
MockRestResponseCreators.withCreatedEntity
(URI location) ResponseCreator
for a 201 response (CREATED) with a 'Location' header.static DefaultResponseCreator
MockRestResponseCreators.withNoContent()
ResponseCreator
for a 204 response (NO_CONTENT).static DefaultResponseCreator
MockRestResponseCreators.withRawStatus
(int status) Variant ofMockRestResponseCreators.withStatus(HttpStatusCode)
with an integer.static DefaultResponseCreator
MockRestResponseCreators.withServerError()
ResponseCreator
for a 500 response (SERVER_ERROR).static DefaultResponseCreator
MockRestResponseCreators.withStatus
(HttpStatusCode status) ResponseCreator
with a specific HTTP status.static DefaultResponseCreator
MockRestResponseCreators.withSuccess()
ResponseCreator
for a 200 response (OK).static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(byte[] body, MediaType contentType) ResponseCreator
for a 200 response (OK) with byte[] body.static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(String body, MediaType contentType) ResponseCreator
for a 200 response (OK) with String body.static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(Resource body, MediaType contentType) ResponseCreator
for a 200 response (OK) content withResource
-based body.static DefaultResponseCreator
MockRestResponseCreators.withUnauthorizedRequest()
ResponseCreator
for a 401 response (UNAUTHORIZED).