@Test
public void testLookup() throws InterruptedException {

    SubscribeInfo subscribeInfo = createSubscribeInfo(true);
    List<ServiceInstance> instances = consulNamingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 0);
    RegisterInfo registerInfo = createRegisterInfo("127.0.0.1", 8012);
    consulNamingService.register(registerInfo);
    Thread.sleep(3 * 1000);
    instances = consulNamingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 1);
    Assert.assertTrue(instances.get(0).getIp().equals("127.0.0.1"));
    Assert.assertTrue(instances.get(0).getPort() == 8012);
    consulNamingService.unregister(registerInfo);
}