@Before public void setUp() throws Exception { pluginId = UUID.randomUUID(); cryptoIndexWorldPluginRoot = new CryptoIndexWorldPluginRoot(); cryptoIndexWorldPluginRoot.setErrorManager(mockErrorManager); cryptoIndexWorldPluginRoot.setPluginDatabaseSystem(mockPluginDatabaseSystem); cryptoIndexWorldPluginRoot.setId(pluginId); setUpMockitoRules(); cryptoIndexDao.initializeDatabase(); cryptoIndexWorldPluginRoot.start(); }
public void TestGetHistoricalExchangeRateFromDatabase() throws Exception { double price = 0; cryptoCurrency = CryptoCurrency.getByCode("BTC"); fiatCurrency = FiatCurrency.getByCode("USD"); Date date = new Date(); time = date.getTime() / 1000; price = cryptoIndexWorldPluginRoot.getHistoricalExchangeRateFromDatabase( cryptoCurrency, fiatCurrency, time); System.out.println(price); }