@Test
public void open() throws ConnectionException, IOException {

  doReturn(false).when(connection).isConnected();
  doReturn(socket).when(connection).createSocket();
  connection.open();
  assertNotNull(connection.getStreamReader());
  assertNotNull(connection.getStreamWriter());
  verify(socket).setSoTimeout(Connection.DEFAULT_SOCKET_TIMEOUT);
  assertEquals(connection.getHost(), Connection.DEFAULT_HOST);
  assertEquals(connection.getPort(), Connection.DEFAULT_PORT);
  assertEquals(connection.getSocketTimeout(), Connection.DEFAULT_SOCKET_TIMEOUT);
  assertEquals(connection.getTimeout(), Connection.DEFAULT_TIMEOUT);
}