@Test
public void testDownloadDependencyHashInvalidOneRetry() throws Exception {

  // When storage.getDependency() is called, return the input stream as if it was downloaded
  // On the first call, return the wrong content to trigger a hash mismatch
  // On the second call, return the correct content
  doReturn(IOUtils.toInputStream(WRONG_CONTENT))
    .doReturn(IOUtils.toInputStream(ThinArchiveTestUtils.getDepAContent())).when(this.storage).getDependency(any());
  // Download ONLY depA
  this.dependencyTransferManager.downloadAllDependencies(depSetA);
  verify(this.storage, times(2)).getDependency(depEq(depA));
}