public void testAdaptTrades() throws IOException {
BigDecimal tradableAmount = new BigDecimal("1.20000000");
BigDecimal price = new BigDecimal("905.10").divide(tradableAmount, RoundingMode.HALF_EVEN);
UserTrade expectedTrade =
new UserTrade(OrderType.BID, tradableAmount, CurrencyPair.BTC_USD, price, DateUtils.fromISO8601DateString("2014-02-06T18:12:38-08:00"), "52f4411767c71baf9000003f", "52f4411767c71baf9000003f", new BigDecimal("9.05"), "USD");
// Read in the JSON from the example resources
InputStream is = CoinbaseAdapterTest.class.getResourceAsStream("/trade/example-transfers-data.json");
// Use Jackson to parse it
ObjectMapper mapper = new ObjectMapper();
CoinbaseTransfers transfers = mapper.readValue(is, CoinbaseTransfers.class);
UserTrades trades = CoinbaseAdapters.adaptTrades(transfers);
List<UserTrade> tradeList = trades.getUserTrades();
assertThat(tradeList.size()).isEqualTo(1);
UserTrade trade = tradeList.get(0);
assertThat(trade).isEqualsToByComparingFields(expectedTrade);
}