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.DefaultResponseCreator.body(org.springframework.core.io.Resource resource) Set the body from aResource.DefaultResponseCreator.contentType(org.springframework.http.MediaType mediaType) Set theContent-Typeheader.DefaultResponseCreator.cookies(org.springframework.http.ResponseCookie... cookies) Add one or more cookies.DefaultResponseCreator.cookies(org.springframework.util.MultiValueMap<String, org.springframework.http.ResponseCookie> multiValueMap) Copy all cookies from the givenMultiValueMap.Add a response header with one or more values.DefaultResponseCreator.headers(org.springframework.http.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(org.springframework.http.HttpStatusCode status) ResponseCreatorwith a specific HTTP status.static DefaultResponseCreatorMockRestResponseCreators.withSuccess()ResponseCreatorfor a 200 response (OK).static DefaultResponseCreatorMockRestResponseCreators.withSuccess(byte[] body, org.springframework.http.MediaType contentType) ResponseCreatorfor a 200 response (OK) with byte[] body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(String body, org.springframework.http.MediaType contentType) ResponseCreatorfor a 200 response (OK) with String body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(org.springframework.core.io.Resource body, org.springframework.http.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).