RedisRegistry extends FailbackRegistry { @Override public boolean isAvailable() { return redisClient.isConnected(); } RedisRegistry(URL url); @Override boolean isAvailable(); @Override void destroy(); @Override void doRegister(URL url); @Override void doUnregister(URL url); @Override void doSubscribe(final URL url, final NotifyListener listener); @Override void doUnsubscribe(URL url, NotifyListener listener);  }
@Test public void testAvailableWithBackup() { URL url = URL.valueOf("redis: Registry registry = new RedisRegistryFactory().createRegistry(url); Registry finalRegistry = registry; assertThrows(JedisConnectionException.class, () -> finalRegistry.isAvailable()); url = URL.valueOf(this.registryUrl.toFullString()).addParameter(BACKUP_KEY, "redisTwo:8881"); registry = new RedisRegistryFactory().createRegistry(url); assertThat(registry.isAvailable(), is(true)); }