RouteHealthEventProcessor implements HealthEventProcessor { protected void closeProxyChain(RedisHealthCheckInstance instance, ProxyChain proxyChain) { EventMonitor.DEFAULT.logEvent("XPIPE.PROXY.CHAIN", String.format("[CLOSE]%s: %s", instance.getRedisInstanceInfo().getDcId(), instance.getRedisInstanceInfo().getShardId())); List<TunnelInfo> tunnelInfos = proxyChain.getTunnels(); List<HostPort> backends = Lists.newArrayList(); for (TunnelInfo tunnelInfo : tunnelInfos) { HostPort hostPort = tunnelInfo.getTunnelStatsResult().getBackend(); backends.add(new HostPort(tunnelInfo.getProxyModel().getHostPort().getHost(), hostPort.getPort())); } proxyService.deleteProxyChain(backends); }  @Override void onEvent(AbstractInstanceEvent event); @VisibleForTesting RouteHealthEventProcessor setMetaCache(MetaCache metaCache); @VisibleForTesting RouteHealthEventProcessor setRedisSessionManager(RedisSessionManager redisSessionManager); @VisibleForTesting RouteHealthEventProcessor setProxyService(ProxyService proxyService); @VisibleForTesting RouteHealthEventProcessor setScheduled(ScheduledExecutorService scheduled);  }
@Test public void testCloseProxyChain() { doCallRealMethod().when(processor).closeProxyChain(any(), any()); processor.closeProxyChain(instance, proxyChain); verify(proxyService, times(1)).deleteProxyChain(anyList()); }