class ChaosSSHClient implements SSHClientWrapper {

    @Override
    public ShellOutput runCommand (String command) {
        log.info("About to run command {}", command);
        try (Session session = getSshClient().startSession()) {
            session.allocateDefaultPTY();
            try (Session.Command exec = session.exec(command)) {
                exec.join();
                int exitCode = exec.getExitStatus();
                String output = IOUtils.readFully(exec.getInputStream()).toString();
                ShellOutput shellOutput = ShellOutput.builder().withExitCode(exitCode).withStdOut(output).build();
                if (exitCode > 0) {
                    log.debug("Command execution failed {}", v("failure", shellOutput));
                }
                return shellOutput;
            }
        } catch (IOException e) {
            throw new ChaosException(SSH_CLIENT_COMMAND_ERROR, e);
        }
    }

}