@Before
    public void setup() {
        consul = ConsulStarterBuilder.consulStarter()
            .withConsulVersion("1.4.0")
            .build()
            .start();

        registryConfig = new RegistryConfig()
            .setProtocol("consul")
            .setAddress("127.0.0.1:" + consul.getHttpPort())
            .setRegister(true);

        registry = (ConsulRegistry) RegistryFactory.getRegistry(registryConfig);
        registry.init();
    }
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