public int getTaskManagerFrequencyInSeconds() {
    return Optional.ofNullable(getProperty(ControllerPeriodicTasksConf.TASK_MANAGER_FREQUENCY_PERIOD))
        .map(period -> (int) convertPeriodToSeconds(period)).orElseGet(
            () -> getProperty(ControllerPeriodicTasksConf.DEPRECATED_TASK_MANAGER_FREQUENCY_IN_SECONDS,
                ControllerPeriodicTasksConf.DEFAULT_TASK_MANAGER_FREQUENCY_IN_SECONDS));
  }
@Test
  public void shouldBeAbleToDisableUsingNewConfig() {
    Map<String, Object> controllerConfig = new HashMap<>();
    ControllerConf conf = new ControllerConf(controllerConfig);
    Assert.assertEquals(conf.getTaskManagerFrequencyInSeconds(), -1);

    controllerConfig = new HashMap<>();
    controllerConfig.put(TASK_MANAGER_FREQUENCY_PERIOD, "0s");
    conf = new ControllerConf(controllerConfig);
    Assert.assertEquals(conf.getTaskManagerFrequencyInSeconds(), 0);

    controllerConfig = new HashMap<>();
    controllerConfig.put(TASK_MANAGER_FREQUENCY_PERIOD, "-1s");
    conf = new ControllerConf(controllerConfig);
    Assert.assertEquals(conf.getTaskManagerFrequencyInSeconds(), -1);
  }