@Test
public void downloadFails_retries() throws Throwable {

  DownloadRunner runner = new DownloadRunner(uri1);
  runner.postDownloadRequest();
  FakeDownloader downloader = runner.getDownloader(0);
  for (int i = 0; i < MIN_RETRY_COUNT; i++) {
    downloader.assertStarted(MAX_RETRY_DELAY).fail();
  }
  downloader.assertStarted(MAX_RETRY_DELAY).unblock();
  downloader.assertReleased().assertStartCount(MIN_RETRY_COUNT + 1);
  runner.getTask().assertCompleted();
  downloadManagerListener.blockUntilTasksComplete();
  assertThat(downloadManager.getCurrentDownloads()).isEmpty();
}