Search in sources :

Example 1 with BTC

use of tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC in project cassandre-trading-bot by cassandre-tech.

the class MarketServiceTest method checkGetTicker.

@Test
@Tag("integration")
@DisplayName("Check get ticker")
public void checkGetTicker() {
    CurrencyPairDTO cp = new CurrencyPairDTO(ETH, BTC);
    Set<TickerDTO> tickers = marketService.getTickers(Collections.singleton(cp));
    final Optional<TickerDTO> t = tickers.stream().filter(tickerDTO -> tickerDTO.getCurrencyPair().equals(cp)).findFirst();
    assertTrue(t.isPresent());
    // currencyPair.
    assertNotNull(t.get().getCurrencyPair());
    assertEquals(t.get().getCurrencyPair(), cp);
    // open.
    assertNull(t.get().getOpen());
    // last.
    assertNotNull(t.get().getLast());
    assertTrue(t.get().getLast().compareTo(ZERO) >= 0);
    // bid.
    // assertNotNull(t.get().getBid());
    // assertTrue(t.get().getBid().compareTo(ZERO) > 0);
    // ask.
    // assertNotNull(t.get().getAsk());
    // assertTrue(t.get().getAsk().compareTo(ZERO) > 0);
    // volume.
    assertNotNull(t.get().getVolume());
    // assertTrue(t.get().getVolume().compareTo(ZERO) > 0);
    // quote volume.
    assertNotNull(t.get().getQuoteVolume());
    // assertTrue(t.get().getQuoteVolume().compareTo(ZERO) > 0);
    // bidSize.
    assertNull(t.get().getBidSize());
    // askSize.
    assertNull(t.get().getAskSize());
    // timestamp.
    assertNotNull(t.get().getTimestamp());
    assertTrue(t.get().getTimestamp().isAfter(ZonedDateTime.now().minusMinutes(1)));
    assertTrue(t.get().getTimestamp().isBefore(ZonedDateTime.now().plusMinutes(1)));
}
Also used : Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) ZonedDateTime(java.time.ZonedDateTime) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Autowired(org.springframework.beans.factory.annotation.Autowired) Set(java.util.Set) ZERO(java.math.BigDecimal.ZERO) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TestPropertySource(org.springframework.test.context.TestPropertySource) DisplayName(org.junit.jupiter.api.DisplayName) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) MarketService(tech.cassandre.trading.bot.service.MarketService) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) BTC(tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) Optional(java.util.Optional) Tag(org.junit.jupiter.api.Tag) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) TickerDTO(tech.cassandre.trading.bot.dto.market.TickerDTO) Collections(java.util.Collections) ETH(tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) TickerDTO(tech.cassandre.trading.bot.dto.market.TickerDTO) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName) Tag(org.junit.jupiter.api.Tag)

Example 2 with BTC

use of tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC in project cassandre-trading-bot by cassandre-tech.

the class TradeServiceTest method checkGetTrades.

@Test
@Tag("integration")
@DisplayName("Check get trades")
public void checkGetTrades() {
    final CurrencyPairDTO cp = new CurrencyPairDTO(BTC, USD);
    // Creates two orders of the same amount (one buy, one sell).
    final OrderCreationResultDTO result1 = strategy.createBuyMarketOrder(cp, new BigDecimal("0.1"));
    final OrderCreationResultDTO result2 = strategy.createSellMarketOrder(cp, new BigDecimal("0.1"));
    // Check that the two orders appears in the trade history.
    assertTrue(result1.isSuccessful());
    assertTrue(result2.isSuccessful());
    await().untilAsserted(() -> assertTrue(tradeService.getTrades().stream().anyMatch(t -> t.getOrderId().equals(result1.getOrder().getOrderId()))));
    await().untilAsserted(() -> assertTrue(tradeService.getTrades().stream().anyMatch(t -> t.getOrderId().equals(result2.getOrder().getOrderId()))));
    // Retrieve trade & test values.
    final Optional<TradeDTO> t = tradeService.getTrades().stream().filter(trade -> trade.getOrderId().equals(result1.getOrder().getOrderId())).findFirst();
    assertTrue(t.isPresent());
    assertNull(t.get().getId());
    assertNotNull(t.get().getTradeId());
    assertEquals(BID, t.get().getType());
    assertEquals(result1.getOrderId(), t.get().getOrderId());
    assertEquals(cp, t.get().getCurrencyPair());
    assertNotNull(t.get().getAmount().getValue());
    assertEquals(BTC, t.get().getAmount().getCurrency());
    assertNotNull(t.get().getPrice().getValue());
    assertNotNull(t.get().getFee().getValue());
    assertNotNull(t.get().getFee().getCurrency());
    assertTrue(t.get().getTimestamp().isAfter(ZonedDateTime.now().minusMinutes(1)));
    assertTrue(t.get().getTimestamp().isBefore(ZonedDateTime.now().plusMinutes(1)));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) BID(tech.cassandre.trading.bot.dto.trade.OrderTypeDTO.BID) ZonedDateTime(java.time.ZonedDateTime) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TradeService(tech.cassandre.trading.bot.service.TradeService) Disabled(org.junit.jupiter.api.Disabled) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) TestableCassandreStrategy(tech.cassandre.trading.bot.test.util.strategies.TestableCassandreStrategy) BigDecimal(java.math.BigDecimal) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BTC(tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) Tag(org.junit.jupiter.api.Tag) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) ETH(tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH) Awaitility.await(org.awaitility.Awaitility.await) USD(tech.cassandre.trading.bot.dto.util.CurrencyDTO.USD) TestPropertySource(org.springframework.test.context.TestPropertySource) TradeDTO(tech.cassandre.trading.bot.dto.trade.TradeDTO) OrderDTO(tech.cassandre.trading.bot.dto.trade.OrderDTO) DisplayName(org.junit.jupiter.api.DisplayName) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) Optional(java.util.Optional) TradeDTO(tech.cassandre.trading.bot.dto.trade.TradeDTO) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) BigDecimal(java.math.BigDecimal) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName) Tag(org.junit.jupiter.api.Tag)

Example 3 with BTC

use of tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC in project cassandre-trading-bot by cassandre-tech.

the class TradeServiceTest method checkGetTrades.

@Test
@Tag("integration")
@DisplayName("Check get trades")
@Disabled("Gemini doesn't support market order")
public void checkGetTrades() {
    final CurrencyPairDTO cp = new CurrencyPairDTO(ETH, BTC);
    // Creates two orders of the same amount (one buy, one sell).
    final OrderCreationResultDTO result1 = strategy.createBuyMarketOrder(cp, new BigDecimal("0.0001"));
    final OrderCreationResultDTO result2 = strategy.createSellMarketOrder(cp, new BigDecimal("0.0001"));
    // Check that the two orders appears in the trade history.
    assertTrue(result1.isSuccessful());
    await().untilAsserted(() -> assertTrue(tradeService.getTrades().stream().anyMatch(t -> t.getOrderId().equals(result1.getOrder().getOrderId()))));
    assertNotNull(result2.getOrder().getOrderId());
    await().untilAsserted(() -> assertTrue(tradeService.getTrades().stream().anyMatch(t -> t.getOrderId().equals(result2.getOrder().getOrderId()))));
    // Retrieve trade & test values.
    final Optional<TradeDTO> t = tradeService.getTrades().stream().filter(trade -> trade.getOrderId().equals(result1.getOrder().getOrderId())).findFirst();
    assertTrue(t.isPresent());
    assertNull(t.get().getId());
    assertNotNull(t.get().getTradeId());
    assertEquals(BID, t.get().getType());
    assertEquals(result1.getOrderId(), t.get().getOrderId());
    assertEquals(cp, t.get().getCurrencyPair());
    assertNotNull(t.get().getAmount().getValue());
    assertEquals(ETH, t.get().getAmount().getCurrency());
    assertNotNull(t.get().getPrice().getValue());
    assertEquals(BTC, t.get().getAmount().getCurrency());
    assertNotNull(t.get().getFee().getValue());
    assertNotNull(t.get().getFee().getCurrency());
    assertTrue(t.get().getTimestamp().isAfter(ZonedDateTime.now().minusMinutes(1)));
    assertTrue(t.get().getTimestamp().isBefore(ZonedDateTime.now().plusMinutes(1)));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) BID(tech.cassandre.trading.bot.dto.trade.OrderTypeDTO.BID) ZonedDateTime(java.time.ZonedDateTime) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TradeService(tech.cassandre.trading.bot.service.TradeService) Disabled(org.junit.jupiter.api.Disabled) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) TestableCassandreStrategy(tech.cassandre.trading.bot.test.util.strategies.TestableCassandreStrategy) BigDecimal(java.math.BigDecimal) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BTC(tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) Tag(org.junit.jupiter.api.Tag) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) NEW(tech.cassandre.trading.bot.dto.trade.OrderStatusDTO.NEW) ETH(tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH) Awaitility.await(org.awaitility.Awaitility.await) ZERO(java.math.BigDecimal.ZERO) TestPropertySource(org.springframework.test.context.TestPropertySource) TradeDTO(tech.cassandre.trading.bot.dto.trade.TradeDTO) OrderDTO(tech.cassandre.trading.bot.dto.trade.OrderDTO) DisplayName(org.junit.jupiter.api.DisplayName) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) Optional(java.util.Optional) TradeDTO(tech.cassandre.trading.bot.dto.trade.TradeDTO) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) BigDecimal(java.math.BigDecimal) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName) Tag(org.junit.jupiter.api.Tag) Disabled(org.junit.jupiter.api.Disabled)

Example 4 with BTC

use of tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC in project cassandre-trading-bot by cassandre-tech.

the class TradeServiceTest method checkCreateBuyLimitOrder.

@Test
@Tag("integration")
@DisplayName("Check creates a buy limit order")
public void checkCreateBuyLimitOrder() {
    final CurrencyPairDTO cp = new CurrencyPairDTO(ETH, BTC);
    // =============================================================================================================
    // Making a buy limit order (Buy 0.0001 ETH).
    final OrderCreationResultDTO result1 = strategy.createBuyLimitOrder(cp, new BigDecimal("0.0001"), new BigDecimal("0.1"));
    assertTrue(result1.isSuccessful());
    assertNull(result1.getErrorMessage());
    assertNull(result1.getException());
    assertNotNull(result1.getOrder().getOrderId());
    // =============================================================================================================
    // Getting a non-existing order.
    assertFalse(tradeService.getOrders().stream().anyMatch(o -> o.getOrderId().equals("")));
    // =============================================================================================================
    // Getting the order and testing the data.
    final Optional<OrderDTO> order1 = tradeService.getOrders().stream().filter(o -> o.getOrderId().equals(result1.getOrder().getOrderId())).findFirst();
    assertTrue(order1.isPresent());
    assertNotNull(order1.get().getOrderId());
    assertEquals(result1.getOrder().getOrderId(), order1.get().getOrderId());
    assertEquals(BID, order1.get().getType());
    assertEquals(cp, order1.get().getCurrencyPair());
    assertEquals(0, order1.get().getAmount().getValue().compareTo(new BigDecimal("0.0001")));
    assertEquals(cp.getBaseCurrency(), order1.get().getAmount().getCurrency());
    assertEquals(0, order1.get().getLimitPrice().getValue().compareTo(new BigDecimal("0.000001")));
    assertEquals(cp.getQuoteCurrency(), order1.get().getLimitPrice().getCurrency());
    assertNull(order1.get().getLeverage());
    assertNull(order1.get().getUserReference());
    assertNotNull(order1.get().getTimestamp());
    assertTrue(order1.get().getTimestamp().isAfter(ZonedDateTime.now().minusMinutes(1)));
    assertTrue(order1.get().getTimestamp().isBefore(ZonedDateTime.now().plusMinutes(1)));
    // Cancel the order.
    tradeService.cancelOrder(result1.getOrder().getOrderId());
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) BID(tech.cassandre.trading.bot.dto.trade.OrderTypeDTO.BID) ZonedDateTime(java.time.ZonedDateTime) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TradeService(tech.cassandre.trading.bot.service.TradeService) Disabled(org.junit.jupiter.api.Disabled) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) TestableCassandreStrategy(tech.cassandre.trading.bot.test.util.strategies.TestableCassandreStrategy) BigDecimal(java.math.BigDecimal) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BTC(tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) Tag(org.junit.jupiter.api.Tag) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) ETH(tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH) Awaitility.await(org.awaitility.Awaitility.await) TestPropertySource(org.springframework.test.context.TestPropertySource) TradeDTO(tech.cassandre.trading.bot.dto.trade.TradeDTO) OrderDTO(tech.cassandre.trading.bot.dto.trade.OrderDTO) DisplayName(org.junit.jupiter.api.DisplayName) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) Optional(java.util.Optional) CurrencyPairDTO(tech.cassandre.trading.bot.dto.util.CurrencyPairDTO) OrderDTO(tech.cassandre.trading.bot.dto.trade.OrderDTO) OrderCreationResultDTO(tech.cassandre.trading.bot.dto.trade.OrderCreationResultDTO) BigDecimal(java.math.BigDecimal) BaseTest(tech.cassandre.trading.bot.test.util.junit.BaseTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName) Tag(org.junit.jupiter.api.Tag)

Example 5 with BTC

use of tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC in project cassandre-trading-bot by cassandre-tech.

the class AccountDataFetcherTest method accountByAccountId.

@Test
@DisplayName("accountByAccountId(accountId: String): Account")
void accountByAccountId() {
    // Query and fields definition.
    GraphQLQueryRequest graphQLQueryRequest = new GraphQLQueryRequest(new AccountByAccountIdGraphQLQuery.Builder().accountId("trade").build(), new AccountByAccountIdProjectionRoot().accountId().name().balances().currency().code().getParent().total().available().frozen().loaned().borrowed().withdrawing().depositing());
    // Query execution.
    Account account = dgsQueryExecutor.executeAndExtractJsonPathAsObject(graphQLQueryRequest.serialize(), "data." + DgsConstants.QUERY.AccountByAccountId, new TypeRef<>() {
    });
    // Tests
    assertNotNull(account);
    assertEquals("trade", account.getAccountId());
    assertEquals("trade account name", account.getName());
    assertEquals(2, account.getBalances().size());
    // Testing BTC balance.
    final Optional<Balance> btcBalance = account.getBalances().stream().filter(balance -> balance.getCurrency().equals(BTC)).findAny();
    assertTrue(btcBalance.isPresent());
    assertEquals(BTC, btcBalance.get().getCurrency());
    assertEquals(0, new BigDecimal("1").compareTo(btcBalance.get().getTotal()));
    assertEquals(0, new BigDecimal("2").compareTo(btcBalance.get().getAvailable()));
    assertEquals(0, new BigDecimal("3").compareTo(btcBalance.get().getFrozen()));
    assertEquals(0, new BigDecimal("4").compareTo(btcBalance.get().getBorrowed()));
    assertEquals(0, new BigDecimal("5").compareTo(btcBalance.get().getLoaned()));
    assertEquals(0, new BigDecimal("6").compareTo(btcBalance.get().getWithdrawing()));
    assertEquals(0, new BigDecimal("7").compareTo(btcBalance.get().getDepositing()));
    // Testing ETH balance.
    final Optional<Balance> ethBalance = account.getBalances().stream().filter(balance -> balance.getCurrency().equals(ETH)).findAny();
    assertTrue(ethBalance.isPresent());
    assertEquals(ETH, ethBalance.get().getCurrency());
    assertEquals(0, new BigDecimal("11").compareTo(ethBalance.get().getTotal()));
    assertEquals(0, new BigDecimal("22").compareTo(ethBalance.get().getAvailable()));
    assertEquals(0, new BigDecimal("33").compareTo(ethBalance.get().getFrozen()));
    assertEquals(0, new BigDecimal("44").compareTo(ethBalance.get().getBorrowed()));
    assertEquals(0, new BigDecimal("55").compareTo(ethBalance.get().getLoaned()));
    assertEquals(0, new BigDecimal("66").compareTo(ethBalance.get().getWithdrawing()));
    assertEquals(0, new BigDecimal("77").compareTo(ethBalance.get().getDepositing()));
}
Also used : DirtiesContext(org.springframework.test.annotation.DirtiesContext) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Balance(tech.cassandre.trading.bot.api.graphql.client.generated.types.Balance) AccountByAccountIdProjectionRoot(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountByAccountIdProjectionRoot) AccountsGraphQLQuery(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountsGraphQLQuery) BaseMock(tech.cassandre.trading.bot.api.graphql.test.util.mock.BaseMock) Account(tech.cassandre.trading.bot.api.graphql.client.generated.types.Account) AccountByAccountIdGraphQLQuery(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountByAccountIdGraphQLQuery) BEFORE_EACH_TEST_METHOD(org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) BigDecimal(java.math.BigDecimal) DgsConstants(tech.cassandre.trading.bot.api.graphql.client.generated.DgsConstants) BTC(tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC) DgsAutoConfiguration(com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) ETH(tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH) AccountsProjectionRoot(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountsProjectionRoot) CassandreTradingBot(tech.cassandre.trading.bot.api.graphql.test.CassandreTradingBot) BaseDataFetcherTest(tech.cassandre.trading.bot.api.graphql.test.util.base.BaseDataFetcherTest) TypeRef(com.jayway.jsonpath.TypeRef) AccountDataFetcher(tech.cassandre.trading.bot.api.graphql.data.AccountDataFetcher) Import(org.springframework.context.annotation.Import) GraphQLQueryRequest(com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest) TestPropertySource(org.springframework.test.context.TestPropertySource) DisplayName(org.junit.jupiter.api.DisplayName) Test(org.junit.jupiter.api.Test) List(java.util.List) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DgsQueryExecutor(com.netflix.graphql.dgs.DgsQueryExecutor) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) AccountByAccountIdProjectionRoot(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountByAccountIdProjectionRoot) Account(tech.cassandre.trading.bot.api.graphql.client.generated.types.Account) AccountByAccountIdGraphQLQuery(tech.cassandre.trading.bot.api.graphql.client.generated.client.AccountByAccountIdGraphQLQuery) Balance(tech.cassandre.trading.bot.api.graphql.client.generated.types.Balance) BigDecimal(java.math.BigDecimal) GraphQLQueryRequest(com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest) BaseDataFetcherTest(tech.cassandre.trading.bot.api.graphql.test.util.base.BaseDataFetcherTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Optional (java.util.Optional)13 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)13 Assertions.assertNotNull (org.junit.jupiter.api.Assertions.assertNotNull)13 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)13 DisplayName (org.junit.jupiter.api.DisplayName)13 Test (org.junit.jupiter.api.Test)13 Autowired (org.springframework.beans.factory.annotation.Autowired)13 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)13 ActiveProfiles (org.springframework.test.context.ActiveProfiles)13 BTC (tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC)13 ETH (tech.cassandre.trading.bot.dto.util.CurrencyDTO.ETH)13 CurrencyPairDTO (tech.cassandre.trading.bot.dto.util.CurrencyPairDTO)11 BigDecimal (java.math.BigDecimal)10 Assertions.assertNull (org.junit.jupiter.api.Assertions.assertNull)10 TestPropertySource (org.springframework.test.context.TestPropertySource)10 ZonedDateTime (java.time.ZonedDateTime)9 Awaitility.await (org.awaitility.Awaitility.await)9 Tag (org.junit.jupiter.api.Tag)9 BaseTest (tech.cassandre.trading.bot.test.util.junit.BaseTest)9 TestableCassandreStrategy (tech.cassandre.trading.bot.test.util.strategies.TestableCassandreStrategy)9