@Test public void configureSchedulerOptionsUsesConfigForFrequency() { final String configString = "iep.leader.bad.path = 10s"; final Config config = ConfigFactory.parseString(configString); assertThatThrownBy(() -> LeaderService.configureSchedulerOptions(config)) .hasMessageContaining("iep.leader.leaderElectorFrequency"); }
@VisibleForTesting static Scheduler.Options configureSchedulerOptions(Config config) { return new Scheduler.Options().withFrequency( Scheduler.Policy.FIXED_DELAY, config.getDuration("iep.leader.leaderElectorFrequency") ); }
LeaderService extends AbstractService { @VisibleForTesting static Scheduler.Options configureSchedulerOptions(Config config) { return new Scheduler.Options().withFrequency( Scheduler.Policy.FIXED_DELAY, config.getDuration("iep.leader.leaderElectorFrequency") ); } }
LeaderService extends AbstractService { @VisibleForTesting static Scheduler.Options configureSchedulerOptions(Config config) { return new Scheduler.Options().withFrequency( Scheduler.Policy.FIXED_DELAY, config.getDuration("iep.leader.leaderElectorFrequency") ); } @Inject  LeaderService(LeaderElector leaderElector, Config config, Registry registry);  LeaderService(
      LeaderElector leaderElector,
      Registry registry,
      Scheduler leaderElectorScheduler,
      Scheduler.Options leaderElectorSchedulerOptions,
      Id leaderElectionsCounterId,
      Timer electorInitializeTimer,
      AtomicLong timeSinceLastElection); }
LeaderService extends AbstractService { @VisibleForTesting static Scheduler.Options configureSchedulerOptions(Config config) { return new Scheduler.Options().withFrequency( Scheduler.Policy.FIXED_DELAY, config.getDuration("iep.leader.leaderElectorFrequency") ); } @Inject  LeaderService(LeaderElector leaderElector, Config config, Registry registry);  LeaderService(
      LeaderElector leaderElector,
      Registry registry,
      Scheduler leaderElectorScheduler,
      Scheduler.Options leaderElectorSchedulerOptions,
      Id leaderElectionsCounterId,
      Timer electorInitializeTimer,
      AtomicLong timeSinceLastElection);  }
LeaderService extends AbstractService { @VisibleForTesting static Scheduler.Options configureSchedulerOptions(Config config) { return new Scheduler.Options().withFrequency( Scheduler.Policy.FIXED_DELAY, config.getDuration("iep.leader.leaderElectorFrequency") ); } @Inject  LeaderService(LeaderElector leaderElector, Config config, Registry registry);  LeaderService(
      LeaderElector leaderElector,
      Registry registry,
      Scheduler leaderElectorScheduler,
      Scheduler.Options leaderElectorSchedulerOptions,
      Id leaderElectionsCounterId,
      Timer electorInitializeTimer,
      AtomicLong timeSinceLastElection);   }