BTCMarketsAccountService extends BTCMarketsAccountServiceRaw implements AccountService { @Override public AccountInfo getAccountInfo() throws IOException { return new AccountInfo( exchange.getExchangeSpecification().getUserName(), BTCMarketsAdapters.adaptWallet(getBTCMarketsBalance())); } BTCMarketsAccountService(Exchange exchange); @Override AccountInfo getAccountInfo(); @Override String withdrawFunds(WithdrawFundsParams params); @Override TradeHistoryParams createFundingHistoryParams(); @Override List<FundingRecord> getFundingHistory(TradeHistoryParams params); @Override String requestDepositAddress(Currency currency, String... args);  }
@Test public void shouldCreateAccountInfo() throws IOException { BTCMarketsBalance balance = parse(BTCMarketsBalance.class); PowerMockito.when( btcm.getBalance( Mockito.eq(SPECIFICATION_API_KEY), Mockito.any(SynchronizedValueFactory.class), Mockito.any(BTCMarketsDigest.class))) .thenReturn(Arrays.asList(balance)); AccountInfo accountInfo = accountService.getAccountInfo(); assertThat(accountInfo.getUsername()).isEqualTo(SPECIFICATION_USERNAME); assertThat(accountInfo.getTradingFee()).isNull(); assertThat(accountInfo.getWallets()).hasSize(1); BtcMarketsAssert.assertEquals( accountInfo.getWallet().getBalance(Currency.BTC), EXPECTED_BALANCE); }