ExecutionService { public List<Integer> getMisfiredJobItems(final List<Integer> items) { List<Integer> result = new ArrayList<>(items.size()); for (int each : items) { if (jobNodeStorage.isJobNodeExisted(ExecutionNode.getMisfireNode(each))) { result.add(each); } } return result; } 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 assertGetMisfiredJobItems() { when(jobNodeStorage.isJobNodeExisted("execution/0/misfire")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("execution/1/misfire")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("execution/2/misfire")).thenReturn(false); assertThat(executionService.getMisfiredJobItems(Arrays.asList(0, 1, 2)), is(Arrays.asList(0, 1))); verify(jobNodeStorage).isJobNodeExisted("execution/0/misfire"); verify(jobNodeStorage).isJobNodeExisted("execution/1/misfire"); verify(jobNodeStorage).isJobNodeExisted("execution/2/misfire"); }