Package com.xeiam.xchange.bitcoinaverage.dto.marketdata

Examples of com.xeiam.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTickers


    // Read in the JSON from the example resources
    InputStream is = BitcoinAverageTickerJSONTest.class.getResourceAsStream("/marketdata/example-ticker-all.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BitcoinAverageTickers bitcoinAverageTicker = mapper.readValue(is, BitcoinAverageTickers.class);

    // Verify that the example data was unmarshalled correctly
    assertTrue(bitcoinAverageTicker.getTickers().containsKey("USD"));
    assertThat(bitcoinAverageTicker.getTickers().get("USD").getLast()).isEqualTo("526.54");
    assertThat(bitcoinAverageTicker.getTickers().get("USD").getAsk()).isEqualTo("527.55");
    assertThat(bitcoinAverageTicker.getTickers().get("USD").getBid()).isEqualTo("525.62");
    assertThat(bitcoinAverageTicker.getTickers().get("USD").getVolume()).isEqualTo("91178.27");
    // assertThat(bitcoinAverageTicker.getTimestamp().toLocaleString()).isEqualTo("16-Apr-2014 6:58:34 PM");
  }
View Full Code Here


  }

  public BitcoinAverageTickers getBitcoinAverageAllTickers() throws IOException {

    // Request data
    BitcoinAverageTickers bitcoinAverageTicker = bitcoinAverage.getAllTickers();

    return bitcoinAverageTicker;
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bitcoinaverage.dto.marketdata.BitcoinAverageTickers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.