Search in sources :

Example 1 with PositionManager

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

the class PositionTest 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);
    final PositionManager positionManager = new PositionManager(executorService);
    Mockito.when(bitfinexApiBroker.getPositionManager()).thenReturn(positionManager);
    return bitfinexApiBroker;
}
Also used : BitfinexApiBroker(com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker) PositionManager(com.github.jnidzwetzki.bitfinex.v2.manager.PositionManager) ExecutorService(java.util.concurrent.ExecutorService)

Aggregations

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