@Test public void testDownload() throws Exception { final File unitDirectory = new File("target/unit"); FileUtils.forceMkdir(unitDirectory); final File sourceFile = new File(unitDirectory, "not.exists"); final File targetFile = new File(unitDirectory, "does.exist"); final FileRequest request = createMockFileRequest(sourceFile.toURI(), targetFile.toURI()); when(channel.get(ArgumentMatchers.<String> any())).thenReturn(serverStream); final StubbedJschSftpProcessor processor = new StubbedJschSftpProcessor(); processor.setConnection(conn); processor.queueDownload(request); processor.download(); verify(channel, times(1)).get(sourceFile.toURI().getPath()); }
public void download() { process(downloadQueue); }
JschSftpProcessor { public void download() { process(downloadQueue); } }
JschSftpProcessor { public void download() { process(downloadQueue); }  }
JschSftpProcessor { public void download() { process(downloadQueue); }  static JschSftpProcessor getProcessor(final FtpProduct product); void download(); void queueDownload(final FileRequest request); void queueUpload(final FileRequest request, final boolean ignoreChmodErrors, final int permissions); abstract Connection getConnection(); void upload(); }
JschSftpProcessor { public void download() { process(downloadQueue); }  static JschSftpProcessor getProcessor(final FtpProduct product); void download(); void queueDownload(final FileRequest request); void queueUpload(final FileRequest request, final boolean ignoreChmodErrors, final int permissions); abstract Connection getConnection(); void upload();  }