ExecutionService { public void setMisfire(final List<Integer> items) { if (!configService.isMonitorExecution()) { return; } for (int each : items) { jobNodeStorage.createJobNodeIfNeeded(ExecutionNode.getMisfireNode(each)); } } ExecutionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void registerJobBegin(final JobExecutionMultipleShardingContext jobExecutionShardingContext); void cleanPreviousExecutionInfo(); void registerJobCompleted(final JobExecutionMultipleShardingContext jobExecutionShardingContext); void setNeedFixExecutionInfoFlag(); void clearRunningInfo(final List<Integer> items); boolean misfireIfNecessary(final List<Integer> items); void setMisfire(final List<Integer> items); List<Integer> getMisfiredJobItems(final List<Integer> items); void clearMisfire(final List<Integer> items); void removeExecutionInfo(); boolean isCompleted(final int item); boolean hasRunningItems(final List<Integer> items); boolean hasRunningItems();  }
@Test public void assertSetMisfireWhenMonitorExecutionDisabled() { when(configService.isMonitorExecution()).thenReturn(false); executionService.setMisfire(Arrays.asList(0, 1, 2)); verify(configService).isMonitorExecution(); verify(jobNodeStorage, times(0)).createJobNodeIfNeeded("execution/0/misfire"); verify(jobNodeStorage, times(0)).createJobNodeIfNeeded("execution/1/misfire"); verify(jobNodeStorage, times(0)).createJobNodeIfNeeded("execution/2/misfire"); }
@Test public void assertSetMisfire() { when(configService.isMonitorExecution()).thenReturn(true); executionService.setMisfire(Arrays.asList(0, 1, 2)); verify(configService).isMonitorExecution(); verify(jobNodeStorage).createJobNodeIfNeeded("execution/0/misfire"); verify(jobNodeStorage).createJobNodeIfNeeded("execution/1/misfire"); verify(jobNodeStorage).createJobNodeIfNeeded("execution/2/misfire"); }