@Bean
    public ConsulClient consulClient(final ConsulProperties consulProperties) {
        String url = consulProperties.getUrl();
        if (StringUtils.isBlank(url)) {
            throw new ShenyuException("sync.consul.url can not be null.");
        }
        try {
            URL consulUrl = new URL(url);
            return consulUrl.getPort() < 0 ? new ConsulClient(consulUrl.getHost()) : new ConsulClient(consulUrl.getHost(), consulUrl.getPort());
        } catch (MalformedURLException e) {
            throw new ShenyuException("sync.consul.url formatter is not incorrect.");
        }
    }
@Test
    public void testConsulClient() {
        ConsulSyncConfiguration consulListener = new ConsulSyncConfiguration();
        ConsulProperties consulProperties = mock(ConsulProperties.class);
        when(consulProperties.getUrl()).thenReturn("http://127.0.0.1:8500");
        assertNotNull(consulListener.consulClient(consulProperties));
    }