JAVA-19534 Cleanup un-committed or un-ignored artifacts - Week 14 - 2023 (#13695)

Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
timis1
2023-03-24 17:41:52 +02:00
committed by GitHub
parent 56c5cefc8c
commit ac8c6842eb
4 changed files with 19 additions and 13 deletions

View File

@@ -7,7 +7,8 @@ import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -25,7 +26,7 @@ public class BinaryFileDownloaderIntegrationTest {
String fileName = "download.txt";
ProgressCallback progressCallback = progress -> assertEquals(100.0, progress, .0);
try (BinaryFileWriter writer = new BinaryFileWriter(new FileOutputStream(fileName), progressCallback); BinaryFileDownloader tested = new BinaryFileDownloader(new OkHttpClient(), writer)) {
try (BinaryFileWriter writer = new BinaryFileWriter(Files.newOutputStream(Paths.get(fileName)), progressCallback); BinaryFileDownloader tested = new BinaryFileDownloader(new OkHttpClient(), writer)) {
long downloaded = tested.download(server.url("/greetings").toString());
assertEquals(body.length(), downloaded);
File downloadedFile = new File(fileName);