Fix missing params

This commit is contained in:
chimp1984 2020-10-11 23:57:12 -05:00
parent 3f4d6e6f23
commit 8baf34a643
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
3 changed files with 16 additions and 15 deletions

View File

@ -94,11 +94,10 @@ public class PreferencesTest {
when(payload.getPreferredTradeCurrency()).thenReturn(usd); when(payload.getPreferredTradeCurrency()).thenReturn(usd);
when(payload.getFiatCurrencies()).thenReturn(fiatCurrencies); when(payload.getFiatCurrencies()).thenReturn(fiatCurrencies);
preferences.readPersisted(); preferences.readPersisted(() -> {
assertEquals(7, preferences.getFiatCurrenciesAsObservable().size());
assertEquals(7, preferences.getFiatCurrenciesAsObservable().size()); assertTrue(preferences.getFiatCurrenciesAsObservable().contains(usd));
assertTrue(preferences.getFiatCurrenciesAsObservable().contains(usd)); });
} }
@Test @Test
@ -115,9 +114,9 @@ public class PreferencesTest {
when(payload.getPreferredTradeCurrency()).thenReturn(new FiatCurrency("USD")); when(payload.getPreferredTradeCurrency()).thenReturn(new FiatCurrency("USD"));
when(payload.getCryptoCurrencies()).thenReturn(cryptoCurrencies); when(payload.getCryptoCurrencies()).thenReturn(cryptoCurrencies);
preferences.readPersisted(); preferences.readPersisted(() -> {
assertTrue(preferences.getCryptoCurrenciesAsObservable().contains(dash));
assertTrue(preferences.getCryptoCurrenciesAsObservable().contains(dash)); });
} }
@Test @Test
@ -136,9 +135,8 @@ public class PreferencesTest {
when(payload.getPreferredTradeCurrency()).thenReturn(usd); when(payload.getPreferredTradeCurrency()).thenReturn(usd);
when(payload.getFiatCurrencies()).thenReturn(fiatCurrencies); when(payload.getFiatCurrencies()).thenReturn(fiatCurrencies);
preferences.readPersisted(); preferences.readPersisted(() -> {
assertEquals("US Dollar (USD)", preferences.getFiatCurrenciesAsObservable().get(0).getNameAndCode());
assertEquals("US Dollar (USD)", preferences.getFiatCurrenciesAsObservable().get(0).getNameAndCode()); });
} }
} }

View File

@ -136,7 +136,8 @@ public class P2PNetworkLoad extends Metric implements MessageListener, SetupList
new PersistenceManager<>(storageDir, persistenceProtoResolver, corruptedStorageFileHandler), maxConnections); new PersistenceManager<>(storageDir, persistenceProtoResolver, corruptedStorageFileHandler), maxConnections);
// init file storage // init file storage
peerManager.readPersisted(); peerManager.readPersisted(() -> {
});
PeerExchangeManager peerExchangeManager = new PeerExchangeManager(networkNode, seedNodeRepository, PeerExchangeManager peerExchangeManager = new PeerExchangeManager(networkNode, seedNodeRepository,
peerManager); peerManager);

View File

@ -137,8 +137,10 @@ public class TestState {
sequenceNrMapPersistenceManager, clock, MAX_SEQUENCE_NUMBER_MAP_SIZE_BEFORE_PURGE); sequenceNrMapPersistenceManager, clock, MAX_SEQUENCE_NUMBER_MAP_SIZE_BEFORE_PURGE);
// Currently TestState only supports reading ProtectedStorageEntries off disk. // Currently TestState only supports reading ProtectedStorageEntries off disk.
p2PDataStorage.readFromResources("unused"); p2PDataStorage.readFromResources("unused", () -> {
p2PDataStorage.readPersisted(); });
p2PDataStorage.readPersisted(() -> {
});
p2PDataStorage.addHashMapChangedListener(hashMapChangedListener); p2PDataStorage.addHashMapChangedListener(hashMapChangedListener);
p2PDataStorage.addAppendOnlyDataStoreListener(appendOnlyDataStoreListener); p2PDataStorage.addAppendOnlyDataStoreListener(appendOnlyDataStoreListener);