类的使用
cn.taketoday.test.web.client.response.DefaultResponseCreator
使用DefaultResponseCreator的程序包
-
cn.taketoday.test.web.client.response中DefaultResponseCreator的使用
修饰符和类型方法说明DefaultResponseCreator.body(byte[] content) Set the body as a byte array.DefaultResponseCreator.body(cn.taketoday.core.io.Resource resource) Set the body from aResource.Set the body as a UTF-8 String.Set the body from a string using the given character set.DefaultResponseCreator.contentType(cn.taketoday.http.MediaType mediaType) Set theContent-Typeheader.DefaultResponseCreator.cookies(cn.taketoday.http.ResponseCookie... cookies) Add one or more cookies.DefaultResponseCreator.cookies(cn.taketoday.util.MultiValueMap<String, cn.taketoday.http.ResponseCookie> multiValueMap) Copy all cookies from the givenMultiValueMap.Add a response header with one or more values.DefaultResponseCreator.headers(cn.taketoday.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(cn.taketoday.http.HttpStatusCode status) ResponseCreatorwith a specific HTTP status.static DefaultResponseCreatorMockRestResponseCreators.withSuccess()ResponseCreatorfor a 200 response (OK).static DefaultResponseCreatorMockRestResponseCreators.withSuccess(byte[] body, cn.taketoday.http.MediaType contentType) ResponseCreatorfor a 200 response (OK) with byte[] body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(cn.taketoday.core.io.Resource body, cn.taketoday.http.MediaType contentType) ResponseCreatorfor a 200 response (OK) content withResource-based body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(String body, cn.taketoday.http.MediaType contentType) ResponseCreatorfor a 200 response (OK) with String 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).