BTCMarketsTradeService extends BTCMarketsTradeServiceRaw implements TradeService { @Override public Collection<Order> getOrder(OrderQueryParams... orderQueryParams) throws IOException { List<Long> orderIds = Arrays.stream(orderQueryParams) .map(orderQueryParams1 -> Long.valueOf(orderQueryParams1.getOrderId())) .collect(Collectors.toList()); return getOrderDetails(orderIds).getOrders().stream() .map(BTCMarketsAdapters::adaptOrder) .collect(Collectors.toList()); } BTCMarketsTradeService(Exchange exchange); @Override String placeMarketOrder(MarketOrder order); @Override String placeLimitOrder(LimitOrder order); @Override OpenOrders getOpenOrders(); @Override OpenOrders getOpenOrders(OpenOrdersParams params); @Override boolean cancelOrder(String orderId); @Override boolean cancelOrder(CancelOrderParams orderParams); @Override UserTrades getTradeHistory(TradeHistoryParams params); @Override Collection<Order> getOrder(OrderQueryParams... orderQueryParams); @Override HistoryParams createTradeHistoryParams(); @Override OpenOrdersParams createOpenOrdersParams();  }
@Test public void shouldGetOrderDetails() throws IOException { List<Long> orderIds = new ArrayList<>(); orderIds.add(1000L); BTCMarketsOrderDetailsRequest btcMarketsOrderDetailsRequest = new BTCMarketsOrderDetailsRequest(orderIds); BTCMarketsOrders btcMarketsOrders = new BTCMarketsOrders(true, "", 0, new ArrayList<>()); BTCMarketsAuthenticated btcm = mock(BTCMarketsAuthenticated.class); PowerMockito.when( btcm.getOrderDetails( Mockito.eq(SPECIFICATION_API_KEY), Mockito.any(SynchronizedValueFactory.class), Mockito.any(BTCMarketsDigest.class), Matchers.eq(btcMarketsOrderDetailsRequest))) .thenReturn(btcMarketsOrders); Whitebox.setInternalState(marketsTradeService, "btcm", btcm); Collection<Order> orders = marketsTradeService.getOrder("1000"); assertThat(orders).hasSize(0); }