Search in sources :

Example 1 with TradeManager

use of com.github.jnidzwetzki.bitfinex.v2.manager.TradeManager in project bitfinex-v2-wss-api-java by jnidzwetzki.

the class TradeManagerTest method buildMockedBitfinexConnection.

/**
 * Build a mocked bitfinex connection
 * @return
 */
private BitfinexApiBroker buildMockedBitfinexConnection() {
    final ExecutorService executorService = Executors.newFixedThreadPool(10);
    final BitfinexApiBroker bitfinexApiBroker = Mockito.mock(BitfinexApiBroker.class);
    Mockito.when(bitfinexApiBroker.getExecutorService()).thenReturn(executorService);
    Mockito.when(bitfinexApiBroker.getApiKey()).thenReturn(API_KEY);
    Mockito.when(bitfinexApiBroker.isAuthenticated()).thenReturn(true);
    Mockito.when(bitfinexApiBroker.getCapabilities()).thenReturn(ConnectionCapabilities.ALL_CAPABILITIES);
    final TradeManager tradeManager = new TradeManager(bitfinexApiBroker);
    Mockito.when(bitfinexApiBroker.getTradeManager()).thenReturn(tradeManager);
    return bitfinexApiBroker;
}
Also used : TradeManager(com.github.jnidzwetzki.bitfinex.v2.manager.TradeManager) BitfinexApiBroker(com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker) ExecutorService(java.util.concurrent.ExecutorService)

Aggregations

BitfinexApiBroker (com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker)1 TradeManager (com.github.jnidzwetzki.bitfinex.v2.manager.TradeManager)1 ExecutorService (java.util.concurrent.ExecutorService)1