Uses of Class
org.springframework.test.web.client.response.DefaultResponseCreator
Packages that use DefaultResponseCreator
-
Uses of DefaultResponseCreator in org.springframework.test.web.client.response
Methods in org.springframework.test.web.client.response that return DefaultResponseCreatorModifier and TypeMethodDescriptionDefaultResponseCreator.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.Set the body from aResource.DefaultResponseCreator.contentType(MediaType mediaType) Set theContent-Typeheader.DefaultResponseCreator.cookies(ResponseCookie... cookies) Add one or more cookies.DefaultResponseCreator.cookies(MultiValueMap<String, ResponseCookie> multiValueMap) Copy all cookies from the givenMultiValueMap.Add a response header with one or more values.DefaultResponseCreator.headers(HttpHeaders headers) Copy all given headers.Set theLocationheader.static DefaultResponseCreatorMockRestResponseCreators.withAccepted()ResponseCreatorfor a 202 response (ACCEPTED).static DefaultResponseCreatorMockRestResponseCreators.withBadGateway()ResponseCreatorfor a 502 response (BAD_GATEWAY).static DefaultResponseCreatorMockRestResponseCreators.withBadRequest()ResponseCreatorfor a 400 response (BAD_REQUEST).static DefaultResponseCreatorMockRestResponseCreators.withCreatedEntity(URI location) ResponseCreatorfor a 201 response (CREATED) with a 'Location' header.static DefaultResponseCreatorMockRestResponseCreators.withForbiddenRequest()ResponseCreatorfor a 403 response (FORBIDDEN).static DefaultResponseCreatorMockRestResponseCreators.withGatewayTimeout()ResponseCreatorfor a 504 response (GATEWAY_TIMEOUT).static DefaultResponseCreatorMockRestResponseCreators.withNoContent()ResponseCreatorfor a 204 response (NO_CONTENT).static DefaultResponseCreatorMockRestResponseCreators.withRawStatus(int status) Variant ofMockRestResponseCreators.withStatus(HttpStatusCode)with an integer.static DefaultResponseCreatorMockRestResponseCreators.withRequestConflict()ResponseCreatorfor a 409 response (CONFLICT).static DefaultResponseCreatorMockRestResponseCreators.withResourceNotFound()ResponseCreatorfor a 404 response (NOT_FOUND).static DefaultResponseCreatorMockRestResponseCreators.withServerError()ResponseCreatorfor a 500 response (SERVER_ERROR).static DefaultResponseCreatorMockRestResponseCreators.withServiceUnavailable()ResponseCreatorfor a 503 response (SERVICE_UNAVAILABLE).static DefaultResponseCreatorMockRestResponseCreators.withStatus(HttpStatusCode status) ResponseCreatorwith a specific HTTP status.static DefaultResponseCreatorMockRestResponseCreators.withSuccess()ResponseCreatorfor a 200 response (OK).static DefaultResponseCreatorMockRestResponseCreators.withSuccess(byte[] body, MediaType contentType) ResponseCreatorfor a 200 response (OK) with byte[] body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(String body, MediaType contentType) ResponseCreatorfor a 200 response (OK) with String body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(Resource body, MediaType contentType) ResponseCreatorfor a 200 response (OK) content withResource-based body.static DefaultResponseCreatorMockRestResponseCreators.withTooManyRequests()ResponseCreatorfor a 429 ratelimited response (TOO_MANY_REQUESTS).static DefaultResponseCreatorMockRestResponseCreators.withTooManyRequests(int retryAfter) ResponseCreatorfor a 429 rate-limited response (TOO_MANY_REQUESTS) with aRetry-Afterheader in seconds.static DefaultResponseCreatorMockRestResponseCreators.withUnauthorizedRequest()ResponseCreatorfor a 401 response (UNAUTHORIZED).