public void register() {
        if (StringUtils.isEmpty(RegisterContext.INSTANCE.getClientInfo().getServiceId())) {
            LOGGER.warning("No service to register for nacos client...");
            return;
        }
        String serviceId = RegisterContext.INSTANCE.getClientInfo().getServiceId();
        String group = nacosRegisterConfig.getGroup();
        instance = nacosServiceManager.buildNacosInstanceFromRegistration();
        try {
            NamingService namingService = nacosServiceManager.getNamingService();
            namingService.registerInstance(serviceId, group, instance);
            LOGGER.log(Level.INFO, String.format(Locale.ENGLISH, "registry success, group={%s},serviceId={%s},"
                    + "instanceIp={%s},instancePort={%s} register finished", group, serviceId, instance.getIp(),
                    instance.getPort()));
        } catch (NacosException e) {
            LOGGER.log(Level.SEVERE, String.format(Locale.ENGLISH, "failed when registry service，serviceId={%s}",
                    serviceId), e);
        }
    }
@Test
    public void testRegister() throws NacosException {
        mockNamingService();
        nacosClient.register();
        Assert.assertNotNull(ReflectUtils.getFieldValue(nacosClient, "instance"));
    }