@Override
    public void persistInstance(final InstanceEntity instance) {
        try {
            Instance inst = new Instance();
            inst.setWeight(1.0d);
            inst.setEphemeral(true);
            inst.setIp(instance.getHost());
            inst.setPort(instance.getPort());
            inst.setInstanceId(buildInstanceNodeName(instance));
            inst.setServiceName(instance.getAppName());
            namingService.registerInstance(instance.getAppName(), groupName, inst);
            LOGGER.info("nacos client register success: {}", inst);
        } catch (NacosException e) {
            throw new ShenyuException(e);
        }
    }
@Test
    public void testPersistInstance() {
        InstanceEntity data = InstanceEntity.builder()
                .appName("shenyu-test")
                .host("shenyu-host")
                .port(9195)
                .build();

        final String key = "shenyu-test-group";
        repository.persistInstance(data);
        assertTrue(storage.containsKey(key));

        final Instance instance = storage.get(key);
        assertEquals(data.getHost(), instance.getIp());
        assertEquals(data.getPort(), instance.getPort());
        assertEquals(data.getAppName(), instance.getServiceName());
        repository.close();
    }