Fix build and tests
This commit is contained in:
parent
1eaecf8358
commit
bbc994fc9b
|
@ -120,8 +120,7 @@ public class DownloadServiceTest {
|
|||
assertFalse("The media in test should not yet been downloaded",
|
||||
DBReader.getFeedMedia(testMedia11.getId()).isDownloaded());
|
||||
|
||||
DownloadRequester.getInstance().downloadMedia(false, InstrumentationRegistry.getTargetContext(),
|
||||
testMedia11.getItem());
|
||||
DownloadRequester.getInstance().downloadMedia(false, InstrumentationRegistry.getTargetContext(), false, testMedia11.getItem());
|
||||
Awaitility.await()
|
||||
.atMost(5000, TimeUnit.MILLISECONDS)
|
||||
.until(() -> feedItemEventListener.getEvents().size() >= numEventsExpected);
|
||||
|
@ -166,7 +165,7 @@ public class DownloadServiceTest {
|
|||
}
|
||||
|
||||
withFeedItemEventListener(feedItemEventListener -> {
|
||||
DownloadRequester.getInstance().downloadMedia(false, context, testMedia11.getItem());
|
||||
DownloadRequester.getInstance().downloadMedia(false, context, false, testMedia11.getItem());
|
||||
withDownloadEventListener(downloadEventListener ->
|
||||
Awaitility.await("download is actually running")
|
||||
.atMost(5000, TimeUnit.MILLISECONDS)
|
||||
|
|
|
@ -77,7 +77,7 @@ public class HttpDownloaderTest {
|
|||
|
||||
private Downloader download(String url, String title, boolean expectedResult, boolean deleteExisting, String username, String password, boolean deleteOnFail) {
|
||||
FeedFile feedFile = setupFeedFile(url, title, deleteExisting);
|
||||
DownloadRequest request = new DownloadRequest(feedFile.getFile_url(), url, title, 0, feedFile.getTypeAsInt(), username, password, deleteOnFail, null);
|
||||
DownloadRequest request = new DownloadRequest(feedFile.getFile_url(), url, title, 0, feedFile.getTypeAsInt(), username, password, deleteOnFail, null, false);
|
||||
Downloader downloader = new HttpDownloader(request);
|
||||
downloader.call();
|
||||
DownloadStatus status = downloader.getResult();
|
||||
|
@ -113,7 +113,7 @@ public class HttpDownloaderTest {
|
|||
public void testCancel() {
|
||||
final String url = httpServer.getBaseUrl() + "/delay/3";
|
||||
FeedFileImpl feedFile = setupFeedFile(url, "delay", true);
|
||||
final Downloader downloader = new HttpDownloader(new DownloadRequest(feedFile.getFile_url(), url, "delay", 0, feedFile.getTypeAsInt()));
|
||||
final Downloader downloader = new HttpDownloader(new DownloadRequest(feedFile.getFile_url(), url, "delay", 0, feedFile.getTypeAsInt(), false));
|
||||
Thread t = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -45,13 +45,13 @@ public class DownloadRequestTest {
|
|||
FeedFile item1 = createFeedItem(1);
|
||||
Bundle arg1 = new Bundle();
|
||||
arg1.putString("arg1", "value1");
|
||||
DownloadRequest request1 = new DownloadRequest.Builder(destStr, item1)
|
||||
DownloadRequest request1 = new DownloadRequest.Builder(destStr, item1, false)
|
||||
.withAuthentication(username1, password1)
|
||||
.withArguments(arg1)
|
||||
.build();
|
||||
|
||||
FeedFile item2 = createFeedItem(2);
|
||||
DownloadRequest request2 = new DownloadRequest.Builder(destStr, item2)
|
||||
DownloadRequest request2 = new DownloadRequest.Builder(destStr, item2, true)
|
||||
.withAuthentication(username2, password2)
|
||||
.build();
|
||||
|
||||
|
|
Loading…
Reference in New Issue