VersionCheckActionFactory extends AbstractLeaderAwareHealthCheckActionFactory implements OneWaySupport { @Override public Class<? extends SiteLeaderAwareHealthCheckAction> support() { return VersionCheckAction.class; }  @Override SiteLeaderAwareHealthCheckAction create(RedisHealthCheckInstance instance); @Override Class<? extends SiteLeaderAwareHealthCheckAction> support();  }
@Test public void testSupport() { Assert.assertEquals(VersionCheckAction.class, factory.support()); }
@Test public void testDestroy() { HealthCheckAction target = null; for(HealthCheckAction action : instance.getHealthCheckActions()) { if(action.getClass().isAssignableFrom(factory.support())) { target = action; factory.destroy((SiteLeaderAwareHealthCheckAction) target); } } logger.info("{}", instance.getHealthCheckActions()); instance.unregister(target); instance.unregister(target); Assert.assertTrue(instance.getHealthCheckActions().isEmpty()); }