@Test
  public void testAdapter() {

    final AccountInfo acctInfo =
        JustcoinAdapters.adaptAccountInfo("test", new JustcoinBalance[] {justcoinBalance});

    assertThat(acctInfo.getWallets().size()).isEqualTo(1);
    assertThat(acctInfo.getTradingFee()).isNull();
  }
Ejemplo n.º 2
0
  @Test
  public void testAccountFundsAdapter() throws IOException {

    // Read in the JSON from the example resources
    InputStream is =
        BitcurexAccountJSONTest.class.getResourceAsStream(
            "/marketdata/example-funds-eur-data.json");

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

    AccountInfo accountInfo = BitcurexAdapters.adaptAccountInfo(bitcurexFunds, "demo");
    System.out.println(accountInfo.toString());

    assertThat(accountInfo.getBalance("BTC").compareTo(new BigDecimal("2.59033845")) == 0);
    assertThat(accountInfo.getBalance("EUR").compareTo(new BigDecimal("6160.06838790")) == 0);
    assertThat(accountInfo.getUsername().toString()).isEqualTo("demo");
  }