BTCMarketsAccountService extends BTCMarketsAccountServiceRaw implements AccountService { @Override public String requestDepositAddress(Currency currency, String... args) throws IOException { BTCMarketsAddressesResponse response = depositAddress(currency); if (response != null) { return response.address; } else { return null; } } 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 shouldRequestDepositAddress() throws IOException { BTCMarketsAddressesResponse response = new BTCMarketsAddressesResponse("address"); ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); PowerMockito.when( btcmv3.depositAddress( Mockito.eq(SPECIFICATION_API_KEY), Mockito.any(SynchronizedValueFactory.class), Mockito.any(BTCMarketsDigestV3.class), captor.capture())) .thenReturn(response); String address = accountService.requestDepositAddress(Currency.BTC); assertThat(captor.getValue()).isEqualTo("BTC"); assertThat(address).isEqualTo("address"); }