クラスの使用
org.springframework.test.web.client.response.DefaultResponseCreator
org.springframework.test.web.client.response 内の DefaultResponseCreator 使用
修飾子と型メソッド説明DefaultResponseCreator.body
(byte[] content) 本体をバイト配列として設定します。本文を UTF-8 文字列として設定します。指定された文字セットを使用して文字列から本体を設定します。Resource
から本体を設定します。DefaultResponseCreator.contentType
(MediaType mediaType) Content-Type
ヘッダーを設定します。DefaultResponseCreator.cookies
(ResponseCookie... cookies) 1 つ以上の Cookie を追加します。DefaultResponseCreator.cookies
(MultiValueMap<StringSE, ResponseCookie> multiValueMap) 指定されたMultiValueMap
からすべての Cookie をコピーします。1 つ以上の値を持つレスポンスヘッダーを追加します。DefaultResponseCreator.headers
(HttpHeaders headers) 指定されたすべてのヘッダーをコピーします。Location
ヘッダーを設定します。static DefaultResponseCreator
MockRestResponseCreators.withAccepted()
202 レスポンス (ACCEPTED) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withBadGateway()
502 レスポンス (BAD_GATEWAY) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withBadRequest()
400 レスポンスのResponseCreator
(BAD_REQUEST)。static DefaultResponseCreator
MockRestResponseCreators.withCreatedEntity
(URISE location) 'Location' ヘッダーを持つ 201 レスポンス(作成済み)のResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withForbiddenRequest()
403 レスポンス (FORBIDDEN) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withGatewayTimeout()
504 レスポンスの場合はResponseCreator
(GATEWAY_TIMEOUT)。static DefaultResponseCreator
MockRestResponseCreators.withNoContent()
204 レスポンスの場合はResponseCreator
(NO_CONTENT)。static DefaultResponseCreator
MockRestResponseCreators.withRawStatus
(int status) 整数を持つMockRestResponseCreators.withStatus(HttpStatusCode)
のバリアント。static DefaultResponseCreator
MockRestResponseCreators.withRequestConflict()
409 レスポンス (CONFLICT) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withResourceNotFound()
404 レスポンス (NOT_FOUND) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withServerError()
500 レスポンスのResponseCreator
(SERVER_ERROR)。static DefaultResponseCreator
MockRestResponseCreators.withServiceUnavailable()
503 レスポンス (SERVICE_UNAVAILABLE) の場合はResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withStatus
(HttpStatusCode status) 特定の HTTP ステータスを持つResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withSuccess()
200 レスポンスのResponseCreator
(OK)。static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(byte[] body, MediaType contentType) byte[] 本体の 200 レスポンス(OK)のResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(StringSE body, MediaType contentType) ストリング本体の 200 レスポンス(OK)のResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withSuccess
(Resource body, MediaType contentType) Resource
ベースのボディを持つ 200 レスポンス(OK)コンテンツのResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withTooManyRequests()
レート制限された 429 レスポンス (TOO_MANY_REQUESTS) のResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withTooManyRequests
(int retryAfter) 秒単位のRetry-After
ヘッダーを含む 429 レート制限レスポンス (TOO_MANY_REQUESTS) のResponseCreator
。static DefaultResponseCreator
MockRestResponseCreators.withUnauthorizedRequest()
401 レスポンス用のResponseCreator
(未承認)。