TradeBinanceWebsocketTransaction extends ProductBinanceWebSocketTransaction { public BinanceRawTrade getRawTrade() { return rawTrade; } TradeBinanceWebsocketTransaction(
      @JsonProperty("e") String eventType,
      @JsonProperty("E") String eventTime,
      @JsonProperty("s") String symbol,
      @JsonProperty("t") long tradeId,
      @JsonProperty("p") BigDecimal price,
      @JsonProperty("q") BigDecimal quantity,
      @JsonProperty("b") long buyerOrderId,
      @JsonProperty("a") long sellerOrderId,
      @JsonProperty("T") long timestamp,
      @JsonProperty("m") boolean buyerMarketMaker,
      @JsonProperty("M") boolean ignore); BinanceRawTrade getRawTrade();  }
@Test public void testMapping() throws Exception { InputStream stream = this.getClass().getResourceAsStream("testTradeEvent.json"); TradeBinanceWebsocketTransaction transaction = mapper.readValue(stream, TradeBinanceWebsocketTransaction.class); assertEquals( BaseBinanceWebSocketTransaction.BinanceWebSocketTypes.TRADE, transaction.getEventType()); BinanceRawTrade rawTrade = transaction.getRawTrade(); assertThat(rawTrade.getEventType()).isEqualTo("trade"); assertThat(rawTrade.getEventTime()).isEqualTo("123456789"); assertThat(rawTrade.getSymbol()).isEqualTo("BNBBTC"); assertThat(rawTrade.getTradeId()).isEqualByComparingTo(12345L); assertThat(rawTrade.getPrice()).isEqualByComparingTo(BigDecimal.valueOf(0.001)); assertThat(rawTrade.getQuantity()).isEqualByComparingTo(BigDecimal.valueOf(100)); assertThat(rawTrade.getBuyerOrderId()).isEqualByComparingTo(88L); assertThat(rawTrade.getSellerOrderId()).isEqualByComparingTo(50L); assertThat(rawTrade.getTimestamp()).isEqualByComparingTo(123456785L); assertThat(rawTrade.isBuyerMarketMaker()); assertThat(rawTrade.isIgnore()); }