ConfigurationService { public void persistJobConfiguration() { checkConflictJob(); registerJobInfo(); } ConfigurationService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void persistJobConfiguration(); int getShardingTotalCount(); Map<Integer, String> getShardingItemParameters(); String getJobParameter(); String getCron(); boolean isMonitorExecution(); int getProcessCountIntervalSeconds(); int getConcurrentDataProcessThreadCount(); int getFetchDataCount(); void checkMaxTimeDiffSecondsTolerable(); boolean isFailover(); boolean isMisfire(); String getJobShardingStrategyClass(); int getMonitorPort(); String getJobName(); boolean inSkipTime(Date now);  }
@Test(expected = JobConflictException.class) public void assertPersistJobConfigurationForJobConflict() { when(jobNodeStorage.isJobNodeExisted(ConfigurationNode.JOB_CLASS)).thenReturn(true); when(jobNodeStorage.getJobNodeData(ConfigurationNode.JOB_CLASS)).thenReturn("ConflictJob"); when(jobNodeStorage.getJobConfiguration()).thenReturn(jobConfig); try { configService.persistJobConfiguration(); } finally { verify(jobNodeStorage).isJobNodeExisted(ConfigurationNode.JOB_CLASS); verify(jobNodeStorage).getJobNodeData(ConfigurationNode.JOB_CLASS); verify(jobNodeStorage, times(2)).getJobConfiguration(); } }