ConfigRewriteCheckAction extends RedisConfigCheckAction { @Override protected void doTask() { instance.getRedisSession().configRewrite(new BiConsumer<String, Throwable>() { @Override public void accept(String s, Throwable throwable) { if(throwable != null) { checkFailReason(throwable); } else { checkPassed(); } } }); } ConfigRewriteCheckAction(ScheduledExecutorService scheduled, RedisHealthCheckInstance instance,
                                    ExecutorService executors, AlertManager alertManager);   }
@Test public void testIgnoreRedisLoadingError() throws Exception { Server server = startServer("-ERR Only CONFIG GET is allowed during loading\r\n"); AlertManager alertManager = mock(AlertManager.class); doNothing().when(alertManager).alert(any(DefaultRedisInstanceInfo.class), any(ALERT_TYPE.class), anyString()); DefaultRedisHealthCheckInstance instance = new DefaultRedisHealthCheckInstance() .setRedisInstanceInfo(new DefaultRedisInstanceInfo("dc", "cluster", "shard", new HostPort(), "SHAJQ", ClusterType.ONE_WAY)) .setSession(new RedisSession(new DefaultEndPoint("localhost", server.getPort()), scheduled, getXpipeNettyClientKeyedObjectPool())); try { new ConfigRewriteCheckAction(scheduled, instance, executors, alertManager).doTask(); sleep(100); } finally { server.stop(); } verify(alertManager, never()).alert(any(DefaultRedisInstanceInfo.class), any(ALERT_TYPE.class), anyString()); }