diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-06-21 09:12:00 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2021-06-21 09:12:00 +0200 |
commit | b3992f3c2c15523b5872677d43c1f733bfec1373 (patch) | |
tree | 5ff50d6b4bdb4d988efa4c018e48b4d63f972748 | |
parent | 7bcae27672e6138c4cbd2160795481c0a7c850fd (diff) |
Fix bug, wrong method was called
Also make sure to use unique file reference
-rw-r--r-- | filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java index 3ac3dc638f9..c4848140b2d 100644 --- a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java +++ b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java @@ -237,17 +237,17 @@ public class FileDownloaderTest { MockConnection connectionPool = new MockConnection(); connectionPool.setResponseHandler(new MockConnection.WaitResponseHandler(timeout.plus(Duration.ofMillis(1000)))); FileDownloader fileDownloader = new FileDownloader(connectionPool, downloadDir, downloads, timeout, sleepBetweenRetries); - FileReference foo = new FileReference("foo"); + FileReference xyzzy = new FileReference("xyzzy"); // Should download since we do not have the file on disk - fileDownloader.downloadIfNeeded(new FileReferenceDownload(foo)); - assertTrue(fileDownloader.isDownloading(foo)); - assertFalse(fileDownloader.getFile(foo).isPresent()); + fileDownloader.downloadIfNeeded(new FileReferenceDownload(xyzzy)); + assertTrue(fileDownloader.isDownloading(xyzzy)); + assertFalse(fileDownloader.getFile(xyzzy).isPresent()); // Receive files to simulate download - receiveFile(); + receiveFile(fileDownloader, xyzzy, "xyzzy.jar", FileReferenceData.Type.file, "content"); // Should not download, since file has already been downloaded - fileDownloader.downloadIfNeeded(new FileReferenceDownload(foo)); + fileDownloader.downloadIfNeeded(new FileReferenceDownload(xyzzy)); // and file should be available - assertTrue(fileDownloader.getFile(foo).isPresent()); + assertTrue(fileDownloader.getFile(xyzzy).isPresent()); } @Test |