NodeDeployTask { public void execute() throws SSHClientException { String nodeNameBase = "CMNode" + torqueNodeDeployment.getSessionId(); String nodeName = nodeNameBase + "_" + nodeNumber; String nodeConfigFileName = configFileName(); uploadNodeConfiguration(nodeConfigFileName, driverAddress()); final String qsubScript = qsubScript(nodeName, nodeConfigFileName, nodeConfiguration.getNumberOfCpus()); final String base64EncodedQsubScript = base64Encode(qsubScript); String submitJobToQsub = "echo \"" + base64EncodedQsubScript + "\"| base64 -d | qsub"; String response = sshClient().executeWithResult(submitJobToQsub); logger.info("Started node, response: {}", response); } NodeDeployTask(TorqueNodeDeployment torqueNodeDeployment, int nodeNumber,
            TorqueNodeConfiguration nodeConfiguration, TorqueConfiguration torqueConfiguration); void execute(); String base64Encode(String toEncode);  }
@Test public void execute() throws Exception { when(sshClient.executeWithResult(anyString())).thenReturn("42"); nodeDeployTask.execute(); verify(sshClient).executeWithResult(contains("qsub")); }