JobSettingsAPIImpl implements JobSettingsAPI { @Override public void updateJobSettings(final JobSettings jobSettings) { JobNodePath jobNodePath = new JobNodePath(jobSettings.getJobName()); updateIfChanged(jobNodePath.getConfigNodePath("shardingTotalCount"), jobSettings.getShardingTotalCount()); updateIfChanged(jobNodePath.getConfigNodePath("cron"), jobSettings.getCron()); updateIfChanged(jobNodePath.getConfigNodePath("shardingItemParameters"), jobSettings.getShardingItemParameters()); updateIfChanged(jobNodePath.getConfigNodePath("jobParameter"), jobSettings.getJobParameter()); updateIfChanged(jobNodePath.getConfigNodePath("monitorExecution"), jobSettings.isMonitorExecution()); updateIfChanged(jobNodePath.getConfigNodePath("processCountIntervalSeconds"), jobSettings.getProcessCountIntervalSeconds()); updateIfChanged(jobNodePath.getConfigNodePath("concurrentDataProcessThreadCount"), jobSettings.getConcurrentDataProcessThreadCount()); updateIfChanged(jobNodePath.getConfigNodePath("fetchDataCount"), jobSettings.getFetchDataCount()); updateIfChanged(jobNodePath.getConfigNodePath("maxTimeDiffSeconds"), jobSettings.getMaxTimeDiffSeconds()); updateIfChanged(jobNodePath.getConfigNodePath("monitorPort"), jobSettings.getMonitorPort()); updateIfChanged(jobNodePath.getConfigNodePath("failover"), jobSettings.isFailover()); updateIfChanged(jobNodePath.getConfigNodePath("misfire"), jobSettings.isMisfire()); updateIfChanged(jobNodePath.getConfigNodePath("skipStartTime"), jobSettings.getSkipStartTime()); updateIfChanged(jobNodePath.getConfigNodePath("skipEndTime"), jobSettings.getSkipEndTime()); updateIfChanged(jobNodePath.getConfigNodePath("jobShardingStrategyClass"), jobSettings.getJobShardingStrategyClass()); updateIfChanged(jobNodePath.getConfigNodePath("description"), jobSettings.getDescription()); }  @Override JobSettings getJobSettings(final String jobName); @Override void updateJobSettings(final JobSettings jobSettings); @Override int addJobSettings(final JobSettings jobSettings);  }
@Test public void assertUpdateJobSettings() { createExpected(); JobSettings jobSettings = new JobSettings(); jobSettings.setJobName("testJob"); jobSettings.setJobClass("TestJob"); jobSettings.setShardingTotalCount(10); jobSettings.setCron(null); jobSettings.setProcessCountIntervalSeconds(300); jobSettings.setConcurrentDataProcessThreadCount(10); jobSettings.setFetchDataCount(100); jobSettings.setMaxTimeDiffSeconds(60000); jobSettings.setMonitorExecution(true); jobSettings.setFailover(true); jobSettings.setMisfire(true); jobSettingsAPI.updateJobSettings(jobSettings); verify(registryCenter).update("/testJob/config/shardingTotalCount", "10"); verify(registryCenter, times(0)).update("/testJob/config/cron", null); }