@@ -0,0 +1,2827 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.camel.component.vertx.http;%0A%0Aimport io.vertx.core.Vertx;%0Aimport io.vertx.core.buffer.Buffer;%0Aimport io.vertx.core.file.AsyncFile;%0Aimport io.vertx.core.file.OpenOptions;%0Aimport io.vertx.ext.web.client.HttpRequest;%0Aimport io.vertx.ext.web.codec.BodyCodec;%0Aimport org.apache.camel.Exchange;%0Aimport org.apache.camel.RoutesBuilder;%0Aimport org.apache.camel.builder.RouteBuilder;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Apublic class VertxHttpStreamingResponseTest extends VertxHttpTestSupport %7B%0A%0A    private static final String MESSAGE = %22Streaming response content%22;%0A%0A    @Test%0A    public void testStreamingResponseToFile() %7B%0A        VertxHttpComponent component = context.getComponent(%22vertx-http%22, VertxHttpComponent.class);%0A        Vertx vertx = component.getVertx();%0A%0A        String path = %22target/streaming.txt%22;%0A        AsyncFile file = vertx.fileSystem().openBlocking(path, new OpenOptions());%0A%0A        VertxHttpBinding binding = new DefaultVertxHttpBinding() %7B%0A            @Override%0A            public HttpRequest%3CBuffer%3E prepareHttpRequest(VertxHttpEndpoint endpoint, Exchange exchange) throws Exception %7B%0A                HttpRequest%3CBuffer%3E request = super.prepareHttpRequest(endpoint, exchange);%0A                request.as(BodyCodec.pipe(file));%0A                return request;%0A            %7D%0A        %7D;%0A%0A        component.setVertxHttpBinding(binding);%0A%0A        try %7B%0A            template.request(getProducerUri(), null);%0A            Buffer buffer = vertx.fileSystem().readFileBlocking(path);%0A            assertEquals(MESSAGE, buffer.toString());%0A        %7D finally %7B%0A            vertx.fileSystem().deleteBlocking(path);%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected RoutesBuilder createRouteBuilder() throws Exception %7B%0A        return new RouteBuilder() %7B%0A            @Override%0A            public void configure() %7B%0A                from(getTestServerUri())%0A                        .setBody().constant(MESSAGE);%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Add a test for streaming responses to file