BTCMarketsExchange extends BaseExchange implements Exchange { @Override public void applySpecification(ExchangeSpecification exchangeSpecification) { super.applySpecification(exchangeSpecification); }  @Override void applySpecification(ExchangeSpecification exchangeSpecification); @Override ExchangeSpecification getDefaultExchangeSpecification(); @Override SynchronizedValueFactory<Long> getNonceFactory(); void setNonceFactory(SynchronizedValueFactory<Long> nonceFactory); static final String CURRENCY_PAIR; }
@Test public void shouldApplySpecificationWithKeys() { exchangeSpecification.getExchangeSpecificParameters(); exchangeSpecification.setApiKey(SPECIFICATION_API_KEY); exchangeSpecification.setSecretKey(SPECIFICATION_SECRET_KEY); exchange.applySpecification(exchangeSpecification); assertThat( (BTCMarketsExchange) Whitebox.getInternalState(exchange.getMarketDataService(), "exchange")) .isEqualTo(exchange); assertThat( (BTCMarketsExchange) Whitebox.getInternalState(exchange.getTradeService(), "exchange")) .isEqualTo(exchange); assertThat( (BTCMarketsExchange) Whitebox.getInternalState(exchange.getAccountService(), "exchange")) .isEqualTo(exchange); }
@Test public void shouldApplySpecificationWithApiKeyOnly() { exchangeSpecification.setApiKey(SPECIFICATION_API_KEY); exchange.applySpecification(exchangeSpecification); assertThat( (BTCMarketsExchange) Whitebox.getInternalState(exchange.getMarketDataService(), "exchange")) .isEqualTo(exchange); assertThat(exchange.getTradeService()).isNull(); assertThat(exchange.getAccountService()).isNull(); }
@Test public void shouldApplySpecificationWithSecretKeyOnly() { exchangeSpecification.setSecretKey(SPECIFICATION_SECRET_KEY); exchange.applySpecification(exchangeSpecification); assertThat( (BTCMarketsExchange) Whitebox.getInternalState(exchange.getMarketDataService(), "exchange")) .isEqualTo(exchange); assertThat(exchange.getTradeService()).isNull(); assertThat(exchange.getAccountService()).isNull(); }