Search in sources :

Example 1 with CmcCurrency

use of org.knowm.xchange.coinmarketcap.pro.v1.dto.marketdata.CmcCurrency in project XChange by knowm.

the class CurrencyMapFetchIntegration method getCmcCurrencyListTest.

@Test
public void getCmcCurrencyListTest() throws Exception {
    List<CmcCurrency> currencyList = cmcMarketDataService.getCmcCurrencyList();
    assertThat(currencyList).isNotNull();
    assertThat(currencyList.size()).isGreaterThan(0);
    Optional<CmcCurrency> btcOptional = currencyList.stream().filter(currency -> "BTC".equals(currency.getSymbol())).findAny();
    CmcCurrency btc = btcOptional.get();
    assertThat(btc).isNotNull();
}
Also used : ExchangeFactory(org.knowm.xchange.ExchangeFactory) List(java.util.List) BeforeClass(org.junit.BeforeClass) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CmcMarketDataService(org.knowm.xchange.coinmarketcap.pro.v1.service.CmcMarketDataService) Optional(java.util.Optional) CmcExchange(org.knowm.xchange.coinmarketcap.pro.v1.CmcExchange) Assume(org.junit.Assume) Test(org.junit.Test) Exchange(org.knowm.xchange.Exchange) CmcCurrency(org.knowm.xchange.coinmarketcap.pro.v1.dto.marketdata.CmcCurrency) CmcCurrency(org.knowm.xchange.coinmarketcap.pro.v1.dto.marketdata.CmcCurrency) Test(org.junit.Test)

Aggregations

List (java.util.List)1 Optional (java.util.Optional)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Assume (org.junit.Assume)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1 Exchange (org.knowm.xchange.Exchange)1 ExchangeFactory (org.knowm.xchange.ExchangeFactory)1 CmcExchange (org.knowm.xchange.coinmarketcap.pro.v1.CmcExchange)1 CmcCurrency (org.knowm.xchange.coinmarketcap.pro.v1.dto.marketdata.CmcCurrency)1 CmcMarketDataService (org.knowm.xchange.coinmarketcap.pro.v1.service.CmcMarketDataService)1