use of org.pentaho.di.trans.steps.sftpput.SFTPPutMeta in project pentaho-kettle by pentaho.
the class SFTPPutDialogTest method connectToSFTP_SeveralTimes_AlwaysReturnTrue.
@Test
public void connectToSFTP_SeveralTimes_AlwaysReturnTrue() throws Exception {
SFTPClient sftp = mock(SFTPClient.class);
SFTPPutDialog sod = new SFTPPutDialog(mock(Shell.class), new SFTPPutMeta(), mock(TransMeta.class), "SFTPPutDialogTest");
SFTPPutDialog sodSpy = spy(sod);
doReturn(sftp).when(sodSpy).createSFTPClient();
assertTrue(sodSpy.connectToSFTP(false, null));
assertTrue(sodSpy.connectToSFTP(false, null));
}
use of org.pentaho.di.trans.steps.sftpput.SFTPPutMeta in project pentaho-kettle by pentaho.
the class SFTPPutDialogTest method connectToSFTP_CreateNewConnection_AfterChange.
@Test
public void connectToSFTP_CreateNewConnection_AfterChange() throws Exception {
SFTPClient sftp = mock(SFTPClient.class);
SFTPPutMeta sodMeta = new SFTPPutMeta();
SFTPPutDialog sod = new SFTPPutDialog(mock(Shell.class), sodMeta, mock(TransMeta.class), "SFTPPutDialogTest");
SFTPPutDialog sodSpy = spy(sod);
doReturn(sftp).when(sodSpy).createSFTPClient();
assertTrue(sodSpy.connectToSFTP(false, null));
sodMeta.setChanged(true);
assertTrue(sodSpy.connectToSFTP(false, null));
verify(sodSpy, times(2)).createSFTPClient();
}
Aggregations