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.getFiatCurrencies()).thenReturn(fiatCurrencies);
preferences.readPersisted();
assertEquals(7, preferences.getFiatCurrenciesAsObservable().size());
assertTrue(preferences.getFiatCurrenciesAsObservable().contains(usd));
preferences.readPersisted(() -> {
assertEquals(7, preferences.getFiatCurrenciesAsObservable().size());
assertTrue(preferences.getFiatCurrenciesAsObservable().contains(usd));
});
}
@Test
@ -115,9 +114,9 @@ public class PreferencesTest {
when(payload.getPreferredTradeCurrency()).thenReturn(new FiatCurrency("USD"));
when(payload.getCryptoCurrencies()).thenReturn(cryptoCurrencies);
preferences.readPersisted();
assertTrue(preferences.getCryptoCurrenciesAsObservable().contains(dash));
preferences.readPersisted(() -> {
assertTrue(preferences.getCryptoCurrenciesAsObservable().contains(dash));
});
}
@Test
@ -136,9 +135,8 @@ public class PreferencesTest {
when(payload.getPreferredTradeCurrency()).thenReturn(usd);
when(payload.getFiatCurrencies()).thenReturn(fiatCurrencies);
preferences.readPersisted();
assertEquals("US Dollar (USD)", preferences.getFiatCurrenciesAsObservable().get(0).getNameAndCode());
preferences.readPersisted(() -> {
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);
// init file storage
peerManager.readPersisted();
peerManager.readPersisted(() -> {
});
PeerExchangeManager peerExchangeManager = new PeerExchangeManager(networkNode, seedNodeRepository,
peerManager);

View File

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