Search in sources :

Example 1 with BasePortfolioManager

use of com.github.jnidzwetzki.cryptobot.portfolio.BasePortfolioManager in project crypto-bot by jnidzwetzki.

the class TestCapitalAllocation method buildPortfolioManager.

/**
 * Build the portfolio manager
 * @return
 * @throws APIException
 */
private PortfolioManager buildPortfolioManager() throws APIException {
    final Collection<Wallet> wallets = new ArrayList<>();
    wallets.add(new Wallet(Wallet.WALLET_TYPE_EXCHANGE, "USD", 1000, 0, 1000));
    final BitfinexApiBroker apiBroker = Mockito.mock(BitfinexApiBroker.class);
    final WalletManager walletManager = Mockito.mock(WalletManager.class);
    Mockito.when(walletManager.getWallets()).thenReturn(wallets);
    Mockito.when(apiBroker.getWalletManager()).thenReturn(walletManager);
    return new BasePortfolioManager(apiBroker, 0.05);
}
Also used : BitfinexApiBroker(com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker) WalletManager(com.github.jnidzwetzki.bitfinex.v2.manager.WalletManager) BasePortfolioManager(com.github.jnidzwetzki.cryptobot.portfolio.BasePortfolioManager) Wallet(com.github.jnidzwetzki.bitfinex.v2.entity.Wallet) ArrayList(java.util.ArrayList)

Aggregations

BitfinexApiBroker (com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker)1 Wallet (com.github.jnidzwetzki.bitfinex.v2.entity.Wallet)1 WalletManager (com.github.jnidzwetzki.bitfinex.v2.manager.WalletManager)1 BasePortfolioManager (com.github.jnidzwetzki.cryptobot.portfolio.BasePortfolioManager)1 ArrayList (java.util.ArrayList)1