@Override
    public void customize(ServiceInstance serviceInstance, ApplicationModel applicationModel) {

        Map<String, String> metadata = serviceInstance.getMetadata();

        String propertyName = resolveMetadataPropertyName(serviceInstance);
        String propertyValue = resolveMetadataPropertyValue(applicationModel);

        if (!isBlank(propertyName) && !isBlank(propertyValue)) {
            metadata.put(propertyName, propertyValue);
        }
    }
@Test
    void test() {
        DubboBootstrap providerBootstrap = DubboBootstrap.newInstance();
        ServiceConfig<DemoService> serviceConfig = new ServiceConfig<>();
        serviceConfig.setInterface(DemoService.class);
        serviceConfig.setRef(new DemoServiceImpl());
        serviceConfig.setDelay(1000);

        ApplicationConfig applicationConfig = new ApplicationConfig("MetadataServiceURLParamsMetadataCustomizerTest");
        applicationConfig.setMetadataType(DEFAULT_METADATA_STORAGE_TYPE);

        providerBootstrap
                .application(applicationConfig)
                .registry(new RegistryConfig("N/A"))
                .protocol(new ProtocolConfig("dubbo", 2002))
                .service(serviceConfig);

        // will start exporter.export()
        providerBootstrap.start();

        ApplicationModel applicationModel = providerBootstrap.getApplicationModel();
        MetadataServiceURLParamsMetadataCustomizer customizer = new MetadataServiceURLParamsMetadataCustomizer();
        customizer.customize(instance, applicationModel);

        String val = instance.getMetadata().get(METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME);
        Assertions.assertNotNull(val);

        Map<String, String> map = JsonUtils.toJavaObject(val, Map.class);
        Assertions.assertEquals(map.get(PORT_KEY), String.valueOf(metadataServiceURL.getPort()));
        Assertions.assertEquals(map.get(PROTOCOL_KEY), metadataServiceURL.getProtocol());
        Assertions.assertEquals(map.get(VERSION_KEY), metadataServiceURL.getVersion());
        Assertions.assertFalse(map.containsKey(TIMESTAMP_KEY));
        Assertions.assertFalse(map.containsKey(GROUP_KEY));
        Assertions.assertFalse(map.containsKey(APPLICATION_KEY));
    }