@Override
    public boolean publishConfigCas(String key, String group, String content, Object ticket) {
        try {
            if (ticket != null && !(ticket instanceof Stat)) {
                throw new IllegalArgumentException("zookeeper publishConfigCas requires stat type ticket");
            }
            String pathKey = buildPathKey(group, key);
            zkClient.createOrUpdate(pathKey, content, false, ticket == null ? 0 : ((Stat) ticket).getVersion());
            return true;
        } catch (Exception e) {
            logger.warn(REGISTRY_ZOOKEEPER_EXCEPTION, "", "", "zookeeper publishConfigCas failed.", e);
            return false;
        }
    }
@Test
    void testPublishConfigCas() {
        String key = "user-service-cas";
        String group = "org.apache.dubbo.service.UserService";
        String content = "test";
        ConfigItem configItem = configuration.getConfigItem(key, group);
        assertTrue(configuration.publishConfigCas(key, group, content, configItem.getTicket()));
        configItem = configuration.getConfigItem(key, group);
        assertEquals("test", configItem.getContent());
        assertTrue(configuration.publishConfigCas(key, group, "newtest", configItem.getTicket()));
        assertFalse(configuration.publishConfigCas(key, group, "newtest2", configItem.getTicket()));
        assertEquals("newtest", configuration.getConfigItem(key, group).getContent());
    }