@Test public void IsAvailable_WhenRemoteDirMissting_Invalid(){ PreferenceHelper pm = mock(PreferenceHelper.class); when(pm.getSFTPHost()).thenReturn("aaa"); when(pm.getSFTPPort()).thenReturn(99); when(pm.getSFTPPassword()).thenReturn("hunter2"); SFTPManager manager = new SFTPManager(pm); assertThat("Remote dir value required", manager.isAvailable(), is(false)); }
@Override public boolean isAvailable() { return validSettings(preferenceHelper.getSFTPRemoteServerPath(), preferenceHelper.getSFTPHost(),preferenceHelper.getSFTPPort(),preferenceHelper.getSFTPPrivateKeyFilePath(), preferenceHelper.getSFTPPrivateKeyPassphrase(),preferenceHelper.getSFTPUser(),preferenceHelper.getSFTPPassword(),preferenceHelper.getSFTPKnownHostKey()); }
SFTPManager extends FileSender { @Override public boolean isAvailable() { return validSettings(preferenceHelper.getSFTPRemoteServerPath(), preferenceHelper.getSFTPHost(),preferenceHelper.getSFTPPort(),preferenceHelper.getSFTPPrivateKeyFilePath(), preferenceHelper.getSFTPPrivateKeyPassphrase(),preferenceHelper.getSFTPUser(),preferenceHelper.getSFTPPassword(),preferenceHelper.getSFTPKnownHostKey()); } }
SFTPManager extends FileSender { @Override public boolean isAvailable() { return validSettings(preferenceHelper.getSFTPRemoteServerPath(), preferenceHelper.getSFTPHost(),preferenceHelper.getSFTPPort(),preferenceHelper.getSFTPPrivateKeyFilePath(), preferenceHelper.getSFTPPrivateKeyPassphrase(),preferenceHelper.getSFTPUser(),preferenceHelper.getSFTPPassword(),preferenceHelper.getSFTPKnownHostKey()); } SFTPManager(PreferenceHelper preferenceHelper); }
SFTPManager extends FileSender { @Override public boolean isAvailable() { return validSettings(preferenceHelper.getSFTPRemoteServerPath(), preferenceHelper.getSFTPHost(),preferenceHelper.getSFTPPort(),preferenceHelper.getSFTPPrivateKeyFilePath(), preferenceHelper.getSFTPPrivateKeyPassphrase(),preferenceHelper.getSFTPUser(),preferenceHelper.getSFTPPassword(),preferenceHelper.getSFTPKnownHostKey()); } SFTPManager(PreferenceHelper preferenceHelper); @Override void uploadFile(List<File> files); void uploadFile(final File file); @Override boolean isAvailable(); @Override boolean hasUserAllowedAutoSending(); @Override boolean accept(File file, String s); }
SFTPManager extends FileSender { @Override public boolean isAvailable() { return validSettings(preferenceHelper.getSFTPRemoteServerPath(), preferenceHelper.getSFTPHost(),preferenceHelper.getSFTPPort(),preferenceHelper.getSFTPPrivateKeyFilePath(), preferenceHelper.getSFTPPrivateKeyPassphrase(),preferenceHelper.getSFTPUser(),preferenceHelper.getSFTPPassword(),preferenceHelper.getSFTPKnownHostKey()); } SFTPManager(PreferenceHelper preferenceHelper); @Override void uploadFile(List<File> files); void uploadFile(final File file); @Override boolean isAvailable(); @Override boolean hasUserAllowedAutoSending(); @Override boolean accept(File file, String s);  }