@Test
    public void testRegister() {
        ProviderConfig<?> providerConfig = providerConfig("consul-test-1", 12200, 12201, 12202);
        registry.register(providerConfig);

        ConsulClient consulClient = new ConsulClient("localhost", consul.getHttpPort());
        HealthServicesRequest request = HealthServicesRequest.newBuilder().setPassing(true).build();
        assertUntil(() -> {
            Response<List<HealthService>> healthServices = consulClient.getHealthServices(INTERFACE_ID, request);
            Assert.assertEquals(3, healthServices.getValue().size());
        }, 10, TimeUnit.SECONDS);

        registry.unRegister(providerConfig);

        assertUntil(() -> {
            Response<List<HealthService>> healthServices = consulClient.getHealthServices(INTERFACE_ID, request);
            Assert.assertEquals(0, healthServices.getValue().size());
        }, 10, TimeUnit.SECONDS);
    }
Consul Registry Tests

@author <a href=mailto:scienjus@gmail.com>ScienJus</a>
registry/registry-consul/src/test/java/com/alipay/sofa/rpc/registry/consul/ConsulRegistryTest.java