mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Use PersistenceManager
This commit is contained in:
parent
fac4200825
commit
486e6f4985
2 changed files with 5 additions and 5 deletions
|
@ -57,9 +57,9 @@ import bisq.common.crypto.KeyRing;
|
|||
import bisq.common.crypto.KeyStorage;
|
||||
import bisq.common.crypto.PubKeyRing;
|
||||
import bisq.common.file.CorruptedStorageFileHandler;
|
||||
import bisq.common.persistence.PersistenceManager;
|
||||
import bisq.common.proto.network.NetworkProtoResolver;
|
||||
import bisq.common.proto.persistable.PersistenceProtoResolver;
|
||||
import bisq.common.storage.Storage;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
@ -148,7 +148,7 @@ public class GuiceSetupTest {
|
|||
assertSingleton(MediationDisputeListService.class);
|
||||
assertSingleton(TraderChatManager.class);
|
||||
|
||||
assertNotSingleton(Storage.class);
|
||||
assertNotSingleton(PersistenceManager.class);
|
||||
}
|
||||
|
||||
private void assertSingleton(Class<?> type) {
|
||||
|
|
|
@ -28,8 +28,8 @@ import bisq.network.p2p.seed.SeedNodeRepository;
|
|||
|
||||
import bisq.common.ClockWatcher;
|
||||
import bisq.common.file.CorruptedStorageFileHandler;
|
||||
import bisq.common.persistence.PersistenceManager;
|
||||
import bisq.common.proto.persistable.PersistenceProtoResolver;
|
||||
import bisq.common.storage.Storage;
|
||||
|
||||
import java.nio.file.Files;
|
||||
|
||||
|
@ -59,8 +59,8 @@ public class MockNode {
|
|||
this.maxConnections = maxConnections;
|
||||
networkNode = mock(NetworkNode.class);
|
||||
File storageDir = Files.createTempDirectory("storage").toFile();
|
||||
Storage<PeerList> storage = new Storage<>(storageDir, mock(PersistenceProtoResolver.class), mock(CorruptedStorageFileHandler.class));
|
||||
peerManager = new PeerManager(networkNode, mock(SeedNodeRepository.class), new ClockWatcher(), maxConnections, storage);
|
||||
PersistenceManager<PeerList> persistenceManager = new PersistenceManager<>(storageDir, mock(PersistenceProtoResolver.class), mock(CorruptedStorageFileHandler.class));
|
||||
peerManager = new PeerManager(networkNode, mock(SeedNodeRepository.class), new ClockWatcher(), maxConnections, persistenceManager);
|
||||
connections = new HashSet<>();
|
||||
when(networkNode.getAllConnections()).thenReturn(connections);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue