// Read in the JSON from the example resources
InputStream is = BitKonanMarketDataJsonTest.class.getResourceAsStream("/marketdata/bitkonan-example-orderbook-data.json");
// Use Jackson to parse it
ObjectMapper mapper = new ObjectMapper();
BitKonanOrderBook orderBook = mapper.readValue(is, BitKonanOrderBook.class);
BitKonanOrderBookElement[] asks = orderBook.getAsks();
assertThat(asks).hasSize(10);
assertTrue(asks[0].getVolume().compareTo(new BigDecimal("0.46557")) == 0);
assertTrue(asks[1].getVolume().compareTo(new BigDecimal("0.5011")) == 0);
BitKonanOrderBookElement[] bids = orderBook.getBids();
assertThat(bids).hasSize(10);
assertTrue(bids[0].getVolume().compareTo(new BigDecimal("0.04455")) == 0);
assertTrue(bids[1].getVolume().compareTo(new BigDecimal("3")) == 0);
}