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
ConstructorsConstructorDescriptionMockClientHttpResponse(int status) MockClientHttpResponse(org.springframework.http.HttpStatusCode status) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>getBody()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".org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> org.springframework.http.HttpHeadersorg.springframework.http.HttpStatusCodevoidvoidvoidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getStatusCodein interfaceorg.springframework.http.client.reactive.ClientHttpResponse
-
getHeaders
public org.springframework.http.HttpHeaders getHeaders()- Specified by:
getHeadersin interfaceorg.springframework.http.HttpMessage
-
getCookies
public org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> getCookies()- Specified by:
getCookiesin interfaceorg.springframework.http.client.reactive.ClientHttpResponse
-
setBody
-
setBody
-
setBody
-
getBody
public reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> getBody()- Specified by:
getBodyin interfaceorg.springframework.http.ReactiveHttpInputMessage
-
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
-