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;
}
Aggregations