@Test(expected = IllegalArgumentException.class) public void assertUpdateJobConfigIfCronIsEmpty() { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName("test_job"); jobConfiguration.setCron(""); jobConfigAPI.updateJobConfiguration(jobConfiguration); }
@Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); } }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  @Override JobConfigurationPOJO getJobConfiguration(final String jobName); @Override void updateJobConfiguration(final JobConfigurationPOJO jobConfig); @Override void removeJobConfiguration(final String jobName); }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  @Override JobConfigurationPOJO getJobConfiguration(final String jobName); @Override void updateJobConfiguration(final JobConfigurationPOJO jobConfig); @Override void removeJobConfiguration(final String jobName);  }