use of com.ctrip.xpipe.redis.core.entity.SentinelMeta in project x-pipe by ctripcorp.
the class DefaultSentinelMonitorsCheckTest method checkSentinel.
@Test
public void checkSentinel() throws Exception {
when(metaCache.findClusterShardBySentinelMonitor(any())).thenReturn(null);
checker.checkSentinel(new SentinelMeta().setAddress("127.0.0.1:5000,127.0.0.1:5001,127.0.0.1:5002"), new HostPort("127.0.0.1", 5000));
verify(alertManager, atLeastOnce()).alert(eq(null), eq(null), eq(null), eq(ALERT_TYPE.SENTINEL_MONITOR_INCONSIS), anyString());
verify(sentinelManager, atLeastOnce()).removeSentinelMonitor(any(), any());
}
use of com.ctrip.xpipe.redis.core.entity.SentinelMeta in project x-pipe by ctripcorp.
the class DefaultSentinelMonitorsCheckTest method checkSentinel2.
@Test
public void checkSentinel2() throws Exception {
when(metaCache.findClusterShardBySentinelMonitor(any())).thenReturn(new Pair<>("cluster", "shard"));
checker.checkSentinel(new SentinelMeta().setAddress("127.0.0.1:5000,127.0.0.1:5001,127.0.0.1:5002"), new HostPort("127.0.0.1", 5000));
verify(alertManager, never()).alert(eq(null), eq(null), eq(null), eq(ALERT_TYPE.SENTINEL_MONITOR_INCONSIS), anyString());
verify(sentinelManager, never()).removeSentinelMonitor(any(), any());
}
Aggregations