InfrastructureDeployer { public void deployInfrastructure(Collection<File> artifactsToPreload) { this.artifactsToPreload = artifactsToPreload; for (File artifact : artifactsToPreload) { remoteResourceManager.addResource(new FileResource(artifact, REMOTE_LIB_DIR)); } deleteConfigurationFiles(); try { sshClient.executeAndSysout("rm -rf " + JPPF_NODE_DIR + "*"); remoteResourceManager.prepareResourceDirectory(); } catch (SSHClientException ex) { logger.warn("SSH Exception", ex); } remoteResourceManager.uploadResources(); remoteResourceManager.deployResources(); } InfrastructureDeployer(SSHClient sshClient);  InfrastructureDeployer(SSHClient sshClient, RemoteResourceManager remoteResourceManager); void deployInfrastructure(Collection<File> artifactsToPreload);  }
@Test public void deployInfrastructure() throws Exception { final Collection<File> artifactsToPreload = new LinkedList<File>(); infrastructureDeployer.deployInfrastructure(artifactsToPreload); verify(sshClient).executeAndSysout(eq("rm -rf jppf-node*")); assertThat(infrastructureDeployer.getArtifactsToPreload(), sameInstance(artifactsToPreload)); }