import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
-
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
}
@SuppressWarnings("unchecked")
- private <T extends SshFuture<T>> ListenableFuture<SshFutureListener<T>> stubAddListener(final T future) {
+ private static <T extends SshFuture<T>> ListenableFuture<SshFutureListener<T>> stubAddListener(final T future) {
final SettableFuture<SshFutureListener<T>> listenerSettableFuture = SettableFuture.create();
doAnswer(new Answer<Object>() {
verify(ctx).fireChannelInactive();
}
- private OpenFuture getSuccessOpenFuture() {
+ private static OpenFuture getSuccessOpenFuture() {
final OpenFuture failedOpenFuture = mock(OpenFuture.class);
doReturn(true).when(failedOpenFuture).isOpened();
return failedOpenFuture;
}
- private AuthFuture getSuccessAuthFuture() {
+ private static AuthFuture getSuccessAuthFuture() {
final AuthFuture authFuture = mock(AuthFuture.class);
doReturn(true).when(authFuture).isSuccess();
return authFuture;
}
- private ConnectFuture getSuccessConnectFuture(final ClientSession sshSession) {
+ private static ConnectFuture getSuccessConnectFuture(final ClientSession sshSession) {
final ConnectFuture connectFuture = mock(ConnectFuture.class);
doReturn(true).when(connectFuture).isConnected();
return connectFuture;
}
- private ClientSession getMockedSshSession(final ChannelSubsystem subsystemChannel) throws IOException {
+ private static ClientSession getMockedSshSession(final ChannelSubsystem subsystemChannel) throws IOException {
final ClientSession sshSession = mock(ClientSession.class);
doReturn("sshSession").when(sshSession).toString();
return subsystemChannel;
}
- private IoOutputStream getMockedIoOutputStream() {
+ private static IoOutputStream getMockedIoOutputStream() {
final IoOutputStream mock = mock(IoOutputStream.class);
final IoWriteFuture ioWriteFuture = mock(IoWriteFuture.class);
doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.<SshFutureListener<IoWriteFuture>>any());
return mock;
}
- private IoInputStream getMockedIoInputStream() {
+ private static IoInputStream getMockedIoInputStream() {
final IoInputStream mock = mock(IoInputStream.class);
final IoReadFuture ioReadFuture = mock(IoReadFuture.class);
doReturn(null).when(ioReadFuture).getException();
verify(promise).setFailure(any(Throwable.class));
}
- private AuthFuture getFailedAuthFuture() {
+ private static AuthFuture getFailedAuthFuture() {
final AuthFuture authFuture = mock(AuthFuture.class);
doReturn(false).when(authFuture).isSuccess();
doReturn(new IllegalStateException()).when(authFuture).getException();
return authFuture;
}
- private OpenFuture getFailedOpenFuture() {
+ private static OpenFuture getFailedOpenFuture() {
final OpenFuture authFuture = mock(OpenFuture.class);
doReturn(false).when(authFuture).isOpened();
doReturn(new IllegalStateException()).when(authFuture).getException();
verify(promise).setFailure(any(Throwable.class));
}
- private ConnectFuture getFailedConnectFuture() {
+ private static ConnectFuture getFailedConnectFuture() {
final ConnectFuture connectFuture = mock(ConnectFuture.class);
doReturn(false).when(connectFuture).isConnected();
doReturn(new IllegalStateException()).when(connectFuture).getException();