From ca192030cf6e06ba143892614bb1a3e4c6aa2946 Mon Sep 17 00:00:00 2001 From: Fedor Dudinskiy Date: Thu, 9 Jun 2022 13:57:37 +0200 Subject: [PATCH] Make all multipart methods blocking --- .../quarkus/ts/http/restclient/reactive/files/FileClient.java | 2 +- .../ts/http/restclient/reactive/files/FileClientResource.java | 2 +- .../ts/http/restclient/reactive/files/FileResource.java | 4 ++-- .../ts/http/restclient/reactive/LargeFileHandlingIT.java | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java index 3dbac6543..c3ee3dd00 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClient.java @@ -50,6 +50,6 @@ public interface FileClient { @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.TEXT_PLAIN) @Path("/upload-multipart") - Uni sendMultipart(@MultipartForm FileWrapper data); + String sendMultipart(@MultipartForm FileWrapper data); } diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClientResource.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClientResource.java index 506b68d36..0dfcbdb46 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClientResource.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileClientResource.java @@ -87,7 +87,7 @@ public Uni downloadMultipartResponse() { @POST @Path("/multipart") @Blocking - public Uni uploadMultipart() { + public String uploadMultipart() { FileWrapper wrapper = new FileWrapper(); wrapper.file = file.toFile(); wrapper.name = file.toString(); diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java index a80d781ac..9e91dc0c0 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java @@ -60,9 +60,9 @@ public Uni upload(File body) { @Produces(MediaType.TEXT_PLAIN) @Path("/upload-multipart") @Blocking - public Uni uploadMultipart(@MultipartForm FileWrapper body) { + public String uploadMultipart(@MultipartForm FileWrapper body) { deathRow.add(body.file); - return Uni.createFrom().item(() -> utils.getSum(body.file.getAbsoluteFile().toPath())); + return utils.getSum(body.file.getAbsoluteFile().toPath()); } @GET diff --git a/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/LargeFileHandlingIT.java b/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/LargeFileHandlingIT.java index 89318084b..72ffe8e48 100644 --- a/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/LargeFileHandlingIT.java +++ b/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/LargeFileHandlingIT.java @@ -156,6 +156,7 @@ public void uploadFileThroughClient() { @Test @DisabledOnOs(value = OS.WINDOWS, disabledReason = "https://github.com/quarkusio/quarkus/issues/24763") + @Disabled("https://github.com/quarkus-qe/quarkus-test-suite/issues/707") public void uploadMultipart() { Response hashSum = app.given().get("/file-client/client-hash"); assertEquals(HttpStatus.SC_OK, hashSum.statusCode());