ConflictCheckActionFactory extends AbstractLeaderAwareHealthCheckActionFactory implements BiDirectionSupport { @Override public ConflictCheckAction create(RedisHealthCheckInstance instance) { ConflictCheckAction action = new ConflictCheckAction(scheduled, instance, executors); action.addListeners(listeners); action.addController(checkController); return action; }  @Override ConflictCheckAction create(RedisHealthCheckInstance instance); @Override Class<? extends SiteLeaderAwareHealthCheckAction> support();  }
@Test public void testCreate() throws Exception { RedisHealthCheckInstance instance = newRandomRedisHealthCheckInstance(FoundationService.DEFAULT.getDataCenter(), ClusterType.BI_DIRECTION, 6379); ConflictCheckAction action = factory.create(instance); action.doStart(); Assert.assertTrue(factory.support().isInstance(action)); Assert.assertEquals(1, action.getControllers().size()); Assert.assertTrue(((HealthCheckActionController)action.getControllers().get(0)).shouldCheck(action.getActionInstance())); Assert.assertTrue(action.getListeners().stream().allMatch(listener -> listener instanceof BiDirectionSupport)); }