public boolean watch(String vGroup) {
        String namingAddr = getNamingAddr();
        String clientAddr = NetUtil.getLocalHost();
        StringBuilder watchAddrBuilder = new StringBuilder(HTTP_PREFIX)
                .append(namingAddr)
                .append("/naming/v1/watch?")
                .append(VGROUP_KEY).append("=").append(vGroup)
                .append("&").append(CLIENT_TERM_KEY).append("=").append(term)
                .append("&").append(TIME_OUT_KEY).append("=").append(LONG_POLL_TIME_OUT_PERIOD)
                .append("&clientAddr=").append(clientAddr);
        String watchAddr = watchAddrBuilder.toString();

        try (CloseableHttpResponse response = HttpClientUtil.doPost(watchAddr, (String) null, null, 30000)) {
            if (response != null) {
                StatusLine statusLine = response.getStatusLine();
                return statusLine != null && statusLine.getStatusCode() == HttpStatus.SC_OK;
            }
        } catch (Exception e) {
            LOGGER.error("watch failed: {}", e.getMessage());
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException ignored) {
            }
        }
        return false;
    }
@Test
    public void testWatch() throws Exception {
        NamingserverRegistryServiceImpl registryService = (NamingserverRegistryServiceImpl) new NamingserverRegistryProvider().provide();

        //1.注册cluster1下的一个节点
        InetSocketAddress inetSocketAddress1 = new InetSocketAddress("127.0.0.1", 8088);
        registryService.register(inetSocketAddress1);

        ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
        int delaySeconds = 500;
        //2.延迟0.5s后在cluster1下创建事务分组group1
        executor.schedule(() -> {
            try {

                String namespace = FILE_CONFIG.getConfig("registry.namingserver.namespace");
                createGroupInCluster(namespace, "group1", "cluster1");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            executor.shutdown();  // 任务执行后关闭执行器
        }, delaySeconds, TimeUnit.MILLISECONDS);
        //3.watch事务分组group1
        long timestamp1 = System.currentTimeMillis();
        boolean needFetch = registryService.watch("group1");
        long timestamp2 = System.currentTimeMillis();
        //4.  0.5s后group1被映射到cluster1下，应该有数据在1s内推送到client端
        assert timestamp2 - timestamp1 < 1500;

        //5. 获取实例
        List<InetSocketAddress> list = registryService.lookup("group1");
        registryService.unsubscribe("group1");
        assertEquals(list.size(), 1);
        InetSocketAddress inetSocketAddress = list.get(0);
        assertEquals(inetSocketAddress.getAddress().getHostAddress(), "127.0.0.1");
        assertEquals(inetSocketAddress.getPort(), 8088);


    }