Class MockClientHttpResponse
java.lang.Object
org.springframework.mock.http.client.reactive.MockClientHttpResponse
- All Implemented Interfaces:
- ClientHttpResponse,- HttpMessage,- ReactiveHttpInputMessage
Mock implementation of 
ClientHttpResponse.- Since:
- 5.0
- Author:
- Brian Clozel, Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionMockClientHttpResponse(int status) MockClientHttpResponse(HttpStatus status) 
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Flux<DataBuffer>getBody()Return the body of the message as aPublisher.reactor.core.publisher.Mono<String>Return the response body aggregated and converted to a String using the charset of the Content-Type response or otherwise as "UTF-8".Return a read-only map of response cookies received from the server.Return the headers of this message.intReturn the HTTP status code (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.Return the HTTP status code as anHttpStatusenum value.voidvoidvoidsetBody(Publisher<DataBuffer> body) toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.http.client.reactive.ClientHttpResponsegetId
- 
Constructor Details- 
MockClientHttpResponse
- 
MockClientHttpResponsepublic MockClientHttpResponse(int status) 
 
- 
- 
Method Details- 
getStatusCodeDescription copied from interface:ClientHttpResponseReturn the HTTP status code as anHttpStatusenum value.- Specified by:
- getStatusCodein interface- ClientHttpResponse
- Returns:
- the HTTP status as an HttpStatus enum value (never null)
- See Also:
 
- 
getRawStatusCodepublic int getRawStatusCode()Description copied from interface:ClientHttpResponseReturn the HTTP status code (potentially non-standard and not resolvable through theHttpStatusenum) as an integer.- Specified by:
- getRawStatusCodein interface- ClientHttpResponse
- Returns:
- the HTTP status as an integer value
- See Also:
 
- 
getHeadersDescription copied from interface:HttpMessageReturn the headers of this message.- Specified by:
- getHeadersin interface- HttpMessage
- Returns:
- a corresponding HttpHeaders object (never null)
 
- 
getCookiesDescription copied from interface:ClientHttpResponseReturn a read-only map of response cookies received from the server.- Specified by:
- getCookiesin interface- ClientHttpResponse
 
- 
setBody
- 
setBody
- 
setBody
- 
getBodyDescription copied from interface:ReactiveHttpInputMessageReturn the body of the message as aPublisher.- Specified by:
- getBodyin interface- ReactiveHttpInputMessage
- Returns:
- the body content publisher
 
- 
getBodyAsStringReturn the response body aggregated and converted to a String using the charset of the Content-Type response or otherwise as "UTF-8".
- 
toString
 
-