Package org.springframework.mock.http.client.reactive

# Class MockClientHttpResponse

java.lang.Object
org.springframework.mock.http.client.reactive.MockClientHttpResponse

All Implemented Interfaces:
  `org.springframework.http.client.reactive.ClientHttpResponse`, `org.springframework.http.HttpMessage`, `org.springframework.http.ReactiveHttpInputMessage`

public class MockClientHttpResponse extends Object implements org.springframework.http.client.reactive.ClientHttpResponse
Mock implementation of `ClientHttpResponse`.

Since:
  5.0
Author:
  Brian Clozel, Rossen Stoyanchev

## Constructor Summary

Constructors
Constructor
Description
`MockClientHttpResponse(int status)`
`MockClientHttpResponse(org.springframework.http.HttpStatusCode status)`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>`
`getBody()`
`reactor.core.publisher.Mono<String>`
`getBodyAsString()`
Return the response body aggregated and converted to a String using the charset of the Content-Type response or otherwise as "UTF-8".
`org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie>`
`getCookies()`
`org.springframework.http.HttpHeaders`
`getHeaders()`
`org.springframework.http.HttpStatusCode`
`getStatusCode()`
`void`
`setBody(String body)`
`void`
`setBody(String body, Charset charset)`
`void`
`setBody(Publisher<org.springframework.core.io.buffer.DataBuffer> body)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.http.client.reactive.ClientHttpResponse

`getId, getRawStatusCode`

## Constructor Details

### MockClientHttpResponse

public MockClientHttpResponse(int status)

### MockClientHttpResponse

public MockClientHttpResponse(org.springframework.http.HttpStatusCode status)

## Method Details

### getStatusCode

public org.springframework.http.HttpStatusCode getStatusCode()

Specified by:
  `getStatusCode` in interface `org.springframework.http.client.reactive.ClientHttpResponse`

### getHeaders

public org.springframework.http.HttpHeaders getHeaders()

Specified by:
  `getHeaders` in interface `org.springframework.http.HttpMessage`

### getCookies

public org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> getCookies()

Specified by:
  `getCookies` in interface `org.springframework.http.client.reactive.ClientHttpResponse`

### setBody

public void setBody(Publisher<org.springframework.core.io.buffer.DataBuffer> body)

### setBody

public void setBody(String body)

### setBody

public void setBody(String body, Charset charset)

### getBody

public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> getBody()

Specified by:
  `getBody` in interface `org.springframework.http.ReactiveHttpInputMessage`

### getBodyAsString

public reactor.core.publisher.Mono<String> getBodyAsString()
Return the response body aggregated and converted to a String using the charset of the Content-Type response or otherwise as "UTF-8".

### toString

public String toString()

Overrides:
  `toString` in class `Object`