@Test void subscribeToSyncChanges_notifiedWhenFirstSyncStarts() { syncManager.subscribeToSyncChanges(syncSubscriber); when(network.streamPeers()).then(i -> Stream.of(peer)); when(peerSync.sync(peer)).thenReturn(new SafeFuture<>()); assertThat(syncManager.start()).isCompleted(); verify(syncSubscriber).onSyncingChange(true); verifyNoMoreInteractions(syncSubscriber); }
public long subscribeToSyncChanges(final SyncSubscriber subscriber) { return syncSubscribers.subscribe(subscriber); }
SyncManager extends Service { public long subscribeToSyncChanges(final SyncSubscriber subscriber) { return syncSubscribers.subscribe(subscriber); } }
SyncManager extends Service { public long subscribeToSyncChanges(final SyncSubscriber subscriber) { return syncSubscribers.subscribe(subscriber); } SyncManager(
      final AsyncRunner asyncRunner,
      final P2PNetwork<Eth2Peer> network,
      final RecentChainData storageClient,
      final PeerSync peerSync); }
SyncManager extends Service { public long subscribeToSyncChanges(final SyncSubscriber subscriber) { return syncSubscribers.subscribe(subscriber); } SyncManager(
      final AsyncRunner asyncRunner,
      final P2PNetwork<Eth2Peer> network,
      final RecentChainData storageClient,
      final PeerSync peerSync); static SyncManager create(
      final AsyncRunner asyncRunner,
      final P2PNetwork<Eth2Peer> network,
      final RecentChainData storageClient,
      final BlockImporter blockImporter,
      final MetricsSystem metricsSystem); long subscribeToSyncChanges(final SyncSubscriber subscriber); void unsubscribeFromSyncChanges(final long subscriberId); SyncingStatus getSyncStatus(); }
SyncManager extends Service { public long subscribeToSyncChanges(final SyncSubscriber subscriber) { return syncSubscribers.subscribe(subscriber); } SyncManager(
      final AsyncRunner asyncRunner,
      final P2PNetwork<Eth2Peer> network,
      final RecentChainData storageClient,
      final PeerSync peerSync); static SyncManager create(
      final AsyncRunner asyncRunner,
      final P2PNetwork<Eth2Peer> network,
      final RecentChainData storageClient,
      final BlockImporter blockImporter,
      final MetricsSystem metricsSystem); long subscribeToSyncChanges(final SyncSubscriber subscriber); void unsubscribeFromSyncChanges(final long subscriberId); SyncingStatus getSyncStatus();  }