SshCommand implements Command, Runnable { @Override public void start(ChannelSession session, Environment env) throws IOException { user = env.getEnv().get(Environment.ENV_USER); new Thread(this, "CitrusSshCommand: " + command).start(); } SshCommand(String command, EndpointAdapter endpointAdapter, SshEndpointConfiguration endpointConfiguration); @Override void start(ChannelSession session, Environment env); @Override void run(); @Override void destroy(ChannelSession session); @Override void setInputStream(InputStream in); @Override void setOutputStream(OutputStream out); @Override void setErrorStream(OutputStream err); @Override void setExitCallback(ExitCallback callback); String getCommand();  }
@Test public void start() throws IOException { Environment env = Mockito.mock(Environment.class); ChannelSession session = Mockito.mock(ChannelSession.class); Map<String,String> map = new HashMap<>(); map.put(Environment.ENV_USER,"roland"); when(env.getEnv()).thenReturn(map); prepare("input","output",null,0); cmd.start(session, env); }