parent
4660ef701e
commit
0fcae5d2c5
|
|
@ -50,9 +50,9 @@ public class MockServerHttpResponse implements ServerHttpResponse {
|
||||||
|
|
||||||
private final MultiValueMap<String, ResponseCookie> cookies = new LinkedMultiValueMap<>();
|
private final MultiValueMap<String, ResponseCookie> cookies = new LinkedMultiValueMap<>();
|
||||||
|
|
||||||
private Publisher<? extends DataBuffer> body;
|
private Flux<DataBuffer> body;
|
||||||
|
|
||||||
private Publisher<? extends Publisher<? extends DataBuffer>> bodyWithFlushes;
|
private Flux<Publisher<DataBuffer>> bodyWithFlushes;
|
||||||
|
|
||||||
private DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
private DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
||||||
|
|
||||||
|
|
@ -77,24 +77,24 @@ public class MockServerHttpResponse implements ServerHttpResponse {
|
||||||
return this.cookies;
|
return this.cookies;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends DataBuffer> getBody() {
|
public Publisher<DataBuffer> getBody() {
|
||||||
return this.body;
|
return this.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends Publisher<? extends DataBuffer>> getBodyWithFlush() {
|
public Publisher<Publisher<DataBuffer>> getBodyWithFlush() {
|
||||||
return this.bodyWithFlushes;
|
return this.bodyWithFlushes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||||
this.body = body;
|
this.body = Flux.from(body);
|
||||||
return Flux.from(this.body).then();
|
return this.body.then();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
||||||
this.bodyWithFlushes = body;
|
this.bodyWithFlushes = Flux.from(body).map(p -> Flux.from(p));
|
||||||
return Flux.from(this.bodyWithFlushes).then();
|
return this.bodyWithFlushes.then();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,9 @@ public class MockServerHttpResponse implements ServerHttpResponse {
|
||||||
|
|
||||||
private final MultiValueMap<String, ResponseCookie> cookies = new LinkedMultiValueMap<>();
|
private final MultiValueMap<String, ResponseCookie> cookies = new LinkedMultiValueMap<>();
|
||||||
|
|
||||||
private Publisher<? extends DataBuffer> body;
|
private Flux<DataBuffer> body;
|
||||||
|
|
||||||
private Publisher<? extends Publisher<? extends DataBuffer>> bodyWithFlushes;
|
private Flux<Publisher<DataBuffer>> bodyWithFlushes;
|
||||||
|
|
||||||
private DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
private DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
||||||
|
|
||||||
|
|
@ -77,24 +77,24 @@ public class MockServerHttpResponse implements ServerHttpResponse {
|
||||||
return this.cookies;
|
return this.cookies;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends DataBuffer> getBody() {
|
public Publisher<DataBuffer> getBody() {
|
||||||
return this.body;
|
return this.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends Publisher<? extends DataBuffer>> getBodyWithFlush() {
|
public Publisher<Publisher<DataBuffer>> getBodyWithFlush() {
|
||||||
return this.bodyWithFlushes;
|
return this.bodyWithFlushes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||||
this.body = body;
|
this.body = Flux.from(body);
|
||||||
return Flux.from(this.body).then();
|
return this.body.then();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
||||||
this.bodyWithFlushes = body;
|
this.bodyWithFlushes = Flux.from(body).map(p -> Flux.from(p));
|
||||||
return Flux.from(this.bodyWithFlushes).then();
|
return this.bodyWithFlushes.then();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,9 @@ public class MockClientHttpRequest extends AbstractClientHttpRequest {
|
||||||
|
|
||||||
private final DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
private final DataBufferFactory bufferFactory = new DefaultDataBufferFactory();
|
||||||
|
|
||||||
private Publisher<? extends DataBuffer> body;
|
private Flux<DataBuffer> body;
|
||||||
|
|
||||||
private Publisher<? extends Publisher<? extends DataBuffer>> bodyWithFlushes;
|
private Flux<Publisher<DataBuffer>> bodyWithFlushes;
|
||||||
|
|
||||||
|
|
||||||
public MockClientHttpRequest() {
|
public MockClientHttpRequest() {
|
||||||
|
|
@ -91,21 +91,21 @@ public class MockClientHttpRequest extends AbstractClientHttpRequest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||||
this.body = body;
|
this.body = Flux.from(body);
|
||||||
return applyBeforeCommit().then(Flux.from(this.body).then());
|
return applyBeforeCommit().then(this.body.then());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body) {
|
||||||
this.bodyWithFlushes = body;
|
this.bodyWithFlushes = Flux.from(body).map(p -> Flux.from(p));
|
||||||
return applyBeforeCommit().then(Flux.from(this.bodyWithFlushes).then());
|
return applyBeforeCommit().then(this.bodyWithFlushes.then());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends DataBuffer> getBody() {
|
public Publisher<DataBuffer> getBody() {
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Publisher<? extends Publisher<? extends DataBuffer>> getBodyWithFlush() {
|
public Publisher<Publisher<DataBuffer>> getBodyWithFlush() {
|
||||||
return bodyWithFlushes;
|
return bodyWithFlushes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue