### Question:
ESBDeploymentPreparer { public void prepareESBDeployment() throws BusNotPreparedException { PreparerTask task = new PreparerTask(); InvokerFactory<Void> factory = new InvokerFactory<Void>(); Invoker<Void> invoker = factory.geNewInvokerInstance(TASK_NAME, task); try { invoker.invoke(); } catch (InvokerException e) { throw new BusNotPreparedException(); } } ESBDeploymentPreparer(CloudNode node); void prepareESBDeployment(); static final String COMMAND; }### Answer:
@Test public void shouldExecuteCommandOnNode() throws JSchException, SshCommandFailed, BusNotPreparedException { ESBDeploymentPreparer preparer = new ESBDeploymentPreparer(node); preparer.sshWaiter = waiter; preparer.prepareESBDeployment(); verify(ssh).runCommand(ESBDeploymentPreparer.COMMAND); }
@Test(expected=BusNotPreparedException.class) public void shouldNotExecuteCommand() throws JSchException, SshCommandFailed, BusNotPreparedException { ESBDeploymentPreparer preparer = new ESBDeploymentPreparer(node); preparer.sshWaiter = badWaiter; preparer.prepareESBDeployment(); }