FailoverService { public void remove(final Collection<MetaInfo> metaInfoList) { for (MetaInfo each : metaInfoList) { regCenter.remove(FailoverNode.getFailoverTaskNodePath(each.toString())); } } FailoverService(final CoordinatorRegistryCenter regCenter); void add(final TaskContext taskContext); Collection<JobContext> getAllEligibleJobContexts(); void remove(final Collection<MetaInfo> metaInfoList); Optional<String> getTaskId(final MetaInfo metaInfo); Map<String, Collection<FailoverTaskInfo>> getAllFailoverTasks();  }
@Test public void assertRemove() { String jobNodePath1 = TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodePath(); String jobNodePath2 = TaskNode.builder().shardingItem(1).type(ExecutionType.FAILOVER).build().getTaskNodePath(); failoverService.remove(Arrays.asList(MetaInfo.from(jobNodePath1), MetaInfo.from(jobNodePath2))); verify(regCenter).remove("/state/failover/test_job/" + jobNodePath1); verify(regCenter).remove("/state/failover/test_job/" + jobNodePath2); }