public void fetch(DownloadAction downloadAction, URLService urlService) throws Exception {
        downloadChecksumFile(downloadAction, urlService.baseRemoteURL());
        downloadArtifact(downloadAction, urlService.baseRemoteURL());
    }
@Test
    public void shouldReturnURLEndsWithDotZipWhenRequestingFolder() throws Exception {
        String src = "cruise-output";
        File destOnAgent = new File("pipelines/cruise/", dest.getPath());

        FetchArtifactBuilder builder = getBuilder(new JobIdentifier("foo", -1, "label-1", "dev", "1", "linux", 1L),
                src, "lib/a.jar",
                new DirHandler(src, destOnAgent), checksumFileHandler);

        when(urlService.baseRemoteURL()).thenReturn("http://foo.bar:8153/go");

        when(checksumFileHandler.url("http://foo.bar:8153/go", "foo/label-1/dev/1/linux")).thenReturn("http://foo.bar:8153/go/files/foo/label-1/dev/1/linux/cruise-output/md5.checksum");

        java.util.Properties properties = new java.util.Properties();
        when(checksumFileHandler.getArtifactMd5Checksums()).thenReturn(new ArtifactMd5Checksums(properties));

        builder.fetch(downloadAction, urlService);

        verify(downloadAction).perform(eq("http://foo.bar:8153/go/files/foo/label-1/dev/1/linux/cruise-output/md5.checksum"), isA(FetchHandler.class));
        verify(downloadAction).perform(eq("http://foo.bar:8153/go/remoting/files/foo/label-1/dev/1/linux/cruise-output.zip"), isA(DirHandler.class));
        verifyNoMoreInteractions(downloadAction);
    }