Collective2Broker implements IBroker { @Override public void cancelOrder(String id) { logger.info("Canceling signal: " + id ); CancelSignalRequest request = new CancelSignalRequest(systemid, id); c2Client.submitCancelSignal(request); } protected  Collective2Broker();  Collective2Broker(String apiKey, String systemid ); @Override void cancelOrder(String id); @Override void cancelOrder(TradeOrder order); @Override void placeOrder(TradeOrder order); @Override String getNextOrderId(); @Override void addOrderEventListener(OrderEventListener listener); @Override void removeOrderEventListener(OrderEventListener listener); @Override void addBrokerErrorListener(BrokerErrorListener listener); @Override void removeBrokerErrorListener(BrokerErrorListener listener); @Override String getFormattedDate(int hour, int minute, int second); @Override String getFormattedDate(ZonedDateTime date); @Override ZonedDateTime getCurrentTime(); @Override void connect(); @Override void disconnect(); @Override boolean isConnected(); @Override void aquireLock(); @Override void releaseLock(); @Override ComboTicker buildComboTicker(Ticker ticker1, Ticker ticker2); @Override ComboTicker buildComboTicker(Ticker ticker1, int ratio1, Ticker ticker2, int ratio2); @Override TradeOrder requestOrderStatus(String orderId); @Override List<TradeOrder> getOpenOrders(); @Override void cancelAndReplaceOrder(String originalOrderId, TradeOrder newOrder); @Override void addTimeUpdateListener(TimeUpdatedListener listener); @Override void removeTimeUpdateListener(TimeUpdatedListener listener); @Override List<Position> getAllPositions();  }
@Test public void testCancelOrder() { String orderId = "123"; TradeOrder order = new TradeOrder(); order.setOrderId(orderId);; CancelSignalRequest request = new CancelSignalRequest(systemId, orderId); testBroker.cancelOrder(order); verify(mockC2Client, times(1)).submitCancelSignal(request); }
@Test public void testCancelOrderById() { String orderId = "123"; CancelSignalRequest request = new CancelSignalRequest(systemId, orderId); testBroker.cancelOrder(orderId); verify(mockC2Client, times(1)).submitCancelSignal(request); }