FailoverService { public void removeFailoverInfo() { for (String each : jobNodeStorage.getJobNodeChildrenKeys(ExecutionNode.ROOT)) { jobNodeStorage.removeJobNodeIfExisted(FailoverNode.getExecutionFailoverNode(Integer.parseInt(each))); } } FailoverService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration); void setCrashedFailoverFlag(final int item); void failoverIfNecessary(); void updateFailoverComplete(final List<Integer> items); List<Integer> getLocalHostFailoverItems(); List<Integer> getLocalHostTakeOffItems(); void removeFailoverInfo();  }
@Test public void assertRemoveFailoverInfo() { when(jobNodeStorage.getJobNodeChildrenKeys("execution")).thenReturn(Arrays.asList("0", "1", "2")); failoverService.removeFailoverInfo(); verify(jobNodeStorage).getJobNodeChildrenKeys("execution"); verify(jobNodeStorage).removeJobNodeIfExisted("execution/0/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("execution/1/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("execution/2/failover"); }