mockConnection.create(); expectLastCall().andReturn(mockClient);
replay(mockConnection);
replay(mockClient);
ssh.sshClientConnection = mockConnection;
BufferLogger logcheck = new BufferLogger(ssh.getClass().getCanonicalName());
ssh.logger = logcheck;
logcheck.setLevel(Level.INFO);
ssh.connect();
Assert.assertEquals(ssh.sshClientConnection, mockConnection);
verify(mockConnection);
verify(mockClient);
Record r = logcheck.assertLogContains("attempt 1 of 5");
logcheck.assertLogDoesntContain("attempt 2 of 5");
Assert.assertEquals(Level.INFO, r.getLevel());
}