@Test
public void testAdaptOrderBook() throws IOException {
BTCTradeDepth btcTradeDepth = mapper.readValue(getClass().getResource("dto/marketdata/depth.json"), BTCTradeDepth.class);
OrderBook orderBook = BTCTradeAdapters.adaptOrderBook(btcTradeDepth, CurrencyPair.BTC_CNY);
assertEquals(50, orderBook.getAsks().size());
assertEquals(50, orderBook.getBids().size());
assertEquals(OrderType.ASK, orderBook.getAsks().get(0).getType());
assertEquals(CurrencyPair.BTC_CNY, orderBook.getAsks().get(0).getCurrencyPair());
assertEquals(new BigDecimal("3756.00000"), orderBook.getAsks().get(0).getLimitPrice());
assertEquals(new BigDecimal("0.685"), orderBook.getAsks().get(0).getTradableAmount());
assertEquals(new BigDecimal("3758.00000"), orderBook.getAsks().get(1).getLimitPrice());
assertEquals(new BigDecimal("0.083"), orderBook.getAsks().get(1).getTradableAmount());
assertEquals(new BigDecimal("4045.00000"), orderBook.getAsks().get(49).getLimitPrice());
assertEquals(new BigDecimal("1.402"), orderBook.getAsks().get(49).getTradableAmount());
assertEquals(OrderType.BID, orderBook.getBids().get(0).getType());
assertEquals(CurrencyPair.BTC_CNY, orderBook.getBids().get(0).getCurrencyPair());
assertEquals(new BigDecimal("3730.00000"), orderBook.getBids().get(0).getLimitPrice());
assertEquals(new BigDecimal("1.066"), orderBook.getBids().get(0).getTradableAmount());
assertEquals(new BigDecimal("3728.01000"), orderBook.getBids().get(1).getLimitPrice());
assertEquals(new BigDecimal("3.000"), orderBook.getBids().get(1).getTradableAmount());
assertEquals(new BigDecimal("2951.00000"), orderBook.getBids().get(49).getLimitPrice());
assertEquals(new BigDecimal("4.000"), orderBook.getBids().get(49).getTradableAmount());
}