@Test public void streamsRequestAndAggregatesResponses() { HttpHandler httpHandler = (request, ctx) -> Eventual.of( LiveHttpResponse.response(OK) .body(ByteStream.from("abcdef", UTF_8)) .build()); HttpResponse response = Mono.from( new HttpStreamer(500, httpHandler) .handle(HttpRequest.post("/") .body("ABCDEF", UTF_8) .build(), requestContext())) .block(); assertThat(response.bodyAs(UTF_8), is("abcdef")); }
@Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return delegate.handle(request.stream(), context) .flatMap(live -> live.aggregate(maxContentBytes)); }
HttpStreamer implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return delegate.handle(request.stream(), context) .flatMap(live -> live.aggregate(maxContentBytes)); } }
HttpStreamer implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return delegate.handle(request.stream(), context) .flatMap(live -> live.aggregate(maxContentBytes)); } HttpStreamer(int maxContentBytes, HttpHandler delegate);  HttpStreamer(HttpHandler delegate); }
HttpStreamer implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return delegate.handle(request.stream(), context) .flatMap(live -> live.aggregate(maxContentBytes)); } HttpStreamer(int maxContentBytes, HttpHandler delegate);  HttpStreamer(HttpHandler delegate); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context); }
HttpStreamer implements WebServiceHandler { @Override public Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context) { return delegate.handle(request.stream(), context) .flatMap(live -> live.aggregate(maxContentBytes)); } HttpStreamer(int maxContentBytes, HttpHandler delegate);  HttpStreamer(HttpHandler delegate); @Override Eventual<HttpResponse> handle(HttpRequest request, HttpInterceptor.Context context);  }