AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkRegistry() { if (registries == null || registries.isEmpty()) { String address = ConfigUtils.getProperty("dubbo.registry.address"); if (address != null && address.length() > 0) { registries = new ArrayList<RegistryConfig>(); String[] as = address.split("\\s*[|]+\\s*"); for (String a : as) { RegistryConfig registryConfig = new RegistryConfig(); registryConfig.setAddress(a); registries.add(registryConfig); } } } if ((registries == null || registries.isEmpty())) { throw new IllegalStateException((getClass().getSimpleName().startsWith("Reference") ? "No such any registry to refer service in consumer " : "No such any registry to export service in provider ") + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", Please add <dubbo:registry address=\"...\" /> to your spring config. If you want unregister, please set <dubbo:service registry=\"N/A\" />"); } for (RegistryConfig registryConfig : registries) { appendProperties(registryConfig); } }  @Deprecated String getLocal(); @Deprecated void setLocal(Boolean local); @Deprecated void setLocal(String local); String getStub(); void setStub(Boolean stub); void setStub(String stub); String getCluster(); void setCluster(String cluster); String getProxy(); void setProxy(String proxy); Integer getConnections(); void setConnections(Integer connections); @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) String getFilter(); void setFilter(String filter); @Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true) String getListener(); void setListener(String listener); String getLayer(); void setLayer(String layer); ApplicationConfig getApplication(); void setApplication(ApplicationConfig application); ModuleConfig getModule(); void setModule(ModuleConfig module); RegistryConfig getRegistry(); void setRegistry(RegistryConfig registry); List<RegistryConfig> getRegistries(); @SuppressWarnings({"unchecked"}) void setRegistries(List<? extends RegistryConfig> registries); MonitorConfig getMonitor(); void setMonitor(String monitor); void setMonitor(MonitorConfig monitor); String getOwner(); void setOwner(String owner); Integer getCallbacks(); void setCallbacks(Integer callbacks); String getOnconnect(); void setOnconnect(String onconnect); String getOndisconnect(); void setOndisconnect(String ondisconnect); String getScope(); void setScope(String scope);  }
@Test(expected = IllegalStateException.class) public void testCheckRegistry2() throws Exception { InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkRegistry(); }