ConsulRegistry extends CommandFailbackRegistry implements Closable { @Override protected String discoverCommand(URL url) { String group = url.getGroup(); String command = lookupCommandUpdate(group); updateCommandCache(group, command, false); return command; } ConsulRegistry(URL url, MotanConsulClient client); ConcurrentHashMap<String, ConcurrentHashMap<URL, ServiceListener>> getServiceListeners(); ConcurrentHashMap<String, ConcurrentHashMap<URL, CommandListener>> getCommandListeners(); @Override void close();  }
@Test public void discoverCommand() throws Exception { String result = registry.discoverCommand(clientUrl); Assert.assertTrue(result.equals("")); String command = "{\"index\":0,\"mergeGroups\":[\"aaa:1\",\"bbb:1\"],\"pattern\":\"*\",\"routeRules\":[]}\n"; client.setKVValue(clientUrl.getGroup(), command); result = registry.discoverCommand(clientUrl); Assert.assertTrue(result.equals(command)); }