SshUtils implements InitializingBean { protected Connection getSshConnectionWithHost(String address) { return new Connection(address, 22); }  void executeCommandOnHostViaSsh(String hostIp, String command); void sendFileToHost(File localfilePath, String remoteFileName, String remotePath, String address); @Override void afterPropertiesSet();  }
@Test public void getSshConnectionWithHostTest() throws Exception { Connection result = spy.getSshConnectionWithHost("address"); Assert.assertEquals("address", result.getHostname()); }