Exemplo n.º 1
0
 @Test
 public void constructsLocalPathForTaskFromSourceUrl() throws Exception {
   when(downloadFolder.makePathForUrl(SOURCE_URL)).thenReturn(LOCAL_PATH);
   downloader.startDownloading(request);
   assertEquals(request.localPath, LOCAL_PATH);
 }
Exemplo n.º 2
0
 @Test
 public void ensuresDownloadFolderExists() throws Exception {
   downloader.startDownloading(request);
   verify(downloadFolder).mkdirs();
 }
Exemplo n.º 3
0
 @Test
 public void submitsTaskToDownloader() throws Exception {
   downloader.startDownloading(request);
   verify(downloadManager).submit(request);
 }