BitfinexOrderStatusResponse[] responses = initOrderStatusResponses();
OpenOrders orders = BitfinexAdapters.adaptOrders(responses);
assertEquals(orders.getOpenOrders().size(), responses.length);
for (int i = 0; i < responses.length; i++) {
LimitOrder order = orders.getOpenOrders().get(i);
long expectedTimestampMillis = responses[i].getTimestamp().multiply(new BigDecimal(1000l)).longValue();
Order.OrderType expectedOrderType = responses[i].getSide().equalsIgnoreCase("buy")
? Order.OrderType.BID
: Order.OrderType.ASK;
assertEquals(String.valueOf(responses[i].getId()), order.getId());
assertEquals(responses[i].getRemainingAmount(), order.getTradableAmount());
assertEquals(BitfinexAdapters.adaptCurrencyPair(SYMBOL), order.getCurrencyPair());
assertEquals(expectedOrderType, order.getType());
assertEquals(expectedTimestampMillis, order.getTimestamp().getTime());
assertEquals(responses[i].getPrice(), order.getLimitPrice());
}
}