@Test
public void testDownloadDependencySuccess() throws Exception {

  // When storage.getDependency() is called, return the input stream as if it was downloaded
  doAnswer((Answer<InputStream>) invocation -> {
    DependencyFile depFile = (DependencyFile) invocation.getArguments()[0];
    String content = depFile.equals(depA) ? ThinArchiveTestUtils.getDepAContent() : ThinArchiveTestUtils.getDepBContent();
    return IOUtils.toInputStream(content);
  }).when(this.storage).getDependency(any());
  // Download depA and depB
  this.dependencyTransferManager.downloadAllDependencies(depSetAB);
  // Assert that the content was written to the files
  assertEquals(ThinArchiveTestUtils.getDepAContent(), FileUtils.readFileToString(depA.getFile()));
  assertEquals(ThinArchiveTestUtils.getDepBContent(), FileUtils.readFileToString(depB.getFile()));
}