FailoverService { public void removeFailoverInfo() { for (String each : jobNodeStorage.getJobNodeChildrenKeys(ShardingNode.ROOT)) { jobNodeStorage.removeJobNodeIfExisted(FailoverNode.getExecutionFailoverNode(Integer.parseInt(each))); } } FailoverService(final CoordinatorRegistryCenter regCenter, final String jobName); void setCrashedFailoverFlag(final int item); void failoverIfNecessary(); void updateFailoverComplete(final Collection<Integer> items); List<Integer> getFailoverItems(final String jobInstanceId); List<Integer> getLocalFailoverItems(); List<Integer> getLocalTakeOffItems(); void removeFailoverInfo();  }
@Test public void assertRemoveFailoverInfo() { when(jobNodeStorage.getJobNodeChildrenKeys("sharding")).thenReturn(Arrays.asList("0", "1", "2")); failoverService.removeFailoverInfo(); verify(jobNodeStorage).getJobNodeChildrenKeys("sharding"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/1/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/2/failover"); }