Skip to content

Commit fba5b5a

Browse files
committed
Fixed downloadFile
1 parent 114d455 commit fba5b5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services-gateway/src/test/java/io/scalecube/services/gateway/files/FileDownloadTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.net.http.HttpResponse;
3535
import java.nio.file.Files;
3636
import java.nio.file.Path;
37+
import java.nio.file.Paths;
3738
import java.time.Duration;
3839
import org.junit.jupiter.api.AfterAll;
3940
import org.junit.jupiter.api.AfterEach;
@@ -320,10 +321,11 @@ void successfulDownload(long fileSize) throws Exception {
320321
}
321322

322323
private static Path downloadFile(String reportUrl) throws Exception {
324+
Path tmpPath = Paths.get(System.getProperty("java.io.tmpdir"));
323325
return HttpClient.newHttpClient()
324326
.send(
325327
HttpRequest.newBuilder().uri(URI.create(reportUrl)).build(),
326-
HttpResponse.BodyHandlers.ofFileDownload(Path.of("target"), CREATE, WRITE))
328+
HttpResponse.BodyHandlers.ofFileDownload(tmpPath, CREATE, WRITE))
327329
.body();
328330
}
329331

0 commit comments

Comments
 (0)