@Test void shouldReturnToInSyncAfterSyncCompletesIfStartupModeIsDisabled() { reset(syncService); final SyncStateTracker tracker = new SyncStateTracker( asyncRunner, syncService, network, STARTUP_TARGET_PEER_COUNT, Duration.ofSeconds(0)); tracker.start().join(); final ArgumentCaptor<SyncSubscriber> syncSubscriberArgumentCaptor = ArgumentCaptor.forClass(SyncSubscriber.class); verify(syncService).subscribeToSyncChanges(syncSubscriberArgumentCaptor.capture()); syncSubscriber = syncSubscriberArgumentCaptor.getValue(); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); syncSubscriber.onSyncingChange(true); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.SYNCING); syncSubscriber.onSyncingChange(false); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); }
public SyncState getCurrentSyncState() { return currentState; }
SyncStateTracker extends Service { public SyncState getCurrentSyncState() { return currentState; } }
SyncStateTracker extends Service { public SyncState getCurrentSyncState() { return currentState; } SyncStateTracker(
      final AsyncRunner asyncRunner,
      final SyncService syncService,
      final P2PNetwork<? extends Peer> network,
      final int startupTargetPeerCount,
      final Duration startupTimeout); }
SyncStateTracker extends Service { public SyncState getCurrentSyncState() { return currentState; } SyncStateTracker(
      final AsyncRunner asyncRunner,
      final SyncService syncService,
      final P2PNetwork<? extends Peer> network,
      final int startupTargetPeerCount,
      final Duration startupTimeout); SyncState getCurrentSyncState(); }
SyncStateTracker extends Service { public SyncState getCurrentSyncState() { return currentState; } SyncStateTracker(
      final AsyncRunner asyncRunner,
      final SyncService syncService,
      final P2PNetwork<? extends Peer> network,
      final int startupTargetPeerCount,
      final Duration startupTimeout); SyncState getCurrentSyncState();  }