import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.channel.DefaultChannelPromise;
+import io.netty.channel.EventLoop;
import java.io.IOException;
import java.net.SocketAddress;
import org.apache.sshd.ClientChannel;
private SocketAddress remoteAddress;
@Mock
private SocketAddress localAddress;
+ @Mock
+ private EventLoop eventLoop;
private AsyncSshHandler asyncSshHandler;
stubAuth();
stubSshClient();
stubChannel();
+ stubEventLoop();
stubCtx();
stubRemoteAddress();
doReturn("channel").when(channel).toString();
}
+ private void stubEventLoop() {
+ doReturn(eventLoop).when(channel).eventLoop();
+ doReturn(Boolean.TRUE).when(eventLoop).inEventLoop();
+ }
+
private void stubSshClient() {
doNothing().when(sshClient).start();
final ConnectFuture connectFuture = mock(ConnectFuture.class);