InteractiveBrokersClient implements InteractiveBrokersClientInterface { @Override public void connect() { ibSocket.connect(); broker.connect(); historicalDataProvider.connect(); quoteEngine.startEngine(); } protected  InteractiveBrokersClient(String host, int port, int clientId); static InteractiveBrokersClientInterface getInstance(String host, int port, int clientId); @Override void connect(); @Override void disconnect(); @Override void subscribeLevel1( Ticker ticker, Level1QuoteListener listener ); @Override void subscribeMarketDepth( Ticker ticker, Level2QuoteListener listener ); @Override void unsubscribeLevel1( Ticker ticker, Level1QuoteListener listener ); @Override void unsubscribeMarketDepth( Ticker ticker, Level2QuoteListener listener ); @Override void addBrokerErrorListener(BrokerErrorListener listener); @Override void removeBrokerErrorListener(BrokerErrorListener listener); @Override void useDelayedData( boolean b ); @Override String getHost(); @Override int getPort(); @Override int getClientId(); @Override void placeOrder(TradeOrder order); @Override void addOrderStatusListener(OrderEventListener listener); @Override String getNextOrderId(); @Override List<TradeOrder> getOpenOrders(); @Override List<BarData> requestHistoricalData(Ticker ticker, Date endDateTime, int duration, BarData.LengthUnit durationLengthUnit, int barSize, BarData.LengthUnit barSizeUnit, IHistoricalDataProvider.ShowProperty whatToShow, boolean useRTH); @Override List<BarData> requestHistoricalData(Ticker ticker, int duration, BarData.LengthUnit lengthUnit, int barSize, BarData.LengthUnit barSizeUnit, IHistoricalDataProvider.ShowProperty showProperty ); @Override List<Position> getOpenPositions(); @Override void subscribeRealtimeBar(RealtimeBarRequest request, RealtimeBarListener listener ); static void setMockInteractiveBrokersClient(InteractiveBrokersClientInterface mockClient, String host, int port, int clientId);  }
@Test public void testConnect() { client.connect(); verify(mockIbSocket).connect(); verify(mockBroker).connect(); verify(mockHistoricalDataProvider).connect(); verify(mockQuoteEngine).startEngine(); }