@Test
public void downloadDirWithChecksum() throws Exception {
File folder = temporaryFolder.newFolder("log");
Files.write(Paths.get(folder.getPath(), "a"), "content for a".getBytes());
Files.write(Paths.get(folder.getPath(), "b"), "content for b".getBytes());
File zip = new ZipUtil().zip(folder, temporaryFolder.newFile("log.zip"), Deflater.NO_COMPRESSION);
httpService.setupDownload("http://far.far.away/log.zip", zip);
httpService.setupDownload("http://far.far.away/log.zip.md5", "s/log/a=524ebd45bd7de3616317127f6e639bd6\ns/log/b=83c0aa3048df233340203c74e8a93d7d");
runBuild(downloadDir(map(
"url", "http://far.far.away/log.zip",
"dest", "dest",
"src", "s/log",
"checksumUrl", "http://far.far.away/log.zip.md5")), Passed);
File dest = new File(sandbox, "dest");
assertThat(console.output(), containsString(String.format("Saved artifact to [%s] after verifying the integrity of its contents", dest.getPath())));
assertThat(FileUtils.readFileToString(new File(dest, "log/a"), UTF_8), is("content for a"));
assertThat(FileUtils.readFileToString(new File(dest, "log/b"), UTF_8), is("content for b"));
}