MetadataIdentifier extends BaseServiceMetadataIdentifier implements BaseMetadataIdentifier { public String getUniqueKey(KeyTypeEnum keyType) { return super.getUniqueKey(keyType, application); } MetadataIdentifier();  MetadataIdentifier(String serviceInterface, String version, String group, String side, String application);  MetadataIdentifier(URL url); String getUniqueKey(KeyTypeEnum keyType); String getIdentifierKey(); String getServiceInterface(); void setServiceInterface(String serviceInterface); String getVersion(); void setVersion(String version); String getGroup(); void setGroup(String group); String getSide(); void setSide(String side); String getApplication(); void setApplication(String application);  }
@Test public void testGetUniqueKey() { String interfaceName = "org.apache.dubbo.metadata.integration.InterfaceNameTestService"; String version = "1.0.0.zk.md"; String group = null; String application = "vic.zk.md"; MetadataIdentifier providerMetadataIdentifier = new MetadataIdentifier(interfaceName, version, group, PROVIDER_SIDE, application); Assertions.assertEquals(providerMetadataIdentifier.getUniqueKey(KeyTypeEnum.PATH), "metadata" + PATH_SEPARATOR + interfaceName + PATH_SEPARATOR + (version == null ? "" : (version + PATH_SEPARATOR)) + (group == null ? "" : (group + PATH_SEPARATOR)) + PROVIDER_SIDE + PATH_SEPARATOR + application); Assertions.assertEquals(providerMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY), interfaceName + MetadataConstants.KEY_SEPARATOR + (version == null ? "" : version) + MetadataConstants.KEY_SEPARATOR + (group == null ? "" : group) + MetadataConstants.KEY_SEPARATOR + PROVIDER_SIDE + MetadataConstants.KEY_SEPARATOR + application); }