### Question:
AbstractMetadataReport implements MetadataReport { String getProtocol(URL url) { String protocol = url.getParameter(Constants.SIDE_KEY); protocol = protocol == null ? url.getProtocol() : protocol; return protocol; } AbstractMetadataReport(URL reportServerURL); URL getUrl(); @Override String toString(); @Override void storeProviderMetadata(MetadataIdentifier providerMetadataIdentifier, FullServiceDefinition serviceDefinition); @Override void storeConsumerMetadata(MetadataIdentifier consumerMetadataIdentifier, Map<String, String> serviceParameterMap); void storeConsumerMetadataTask(MetadataIdentifier consumerMetadataIdentifier, Map<String, String> serviceParameterMap); boolean retry(); public MetadataReportRetry metadataReportRetry; }### Answer:
@Test public void testGetProtocol() { URL url = URL.valueOf("dubbo: String protocol = abstractMetadataReport.getProtocol(url); Assertions.assertEquals(protocol, "provider"); URL url2 = URL.valueOf("consumer: String protocol2 = abstractMetadataReport.getProtocol(url2); Assertions.assertEquals(protocol2, "consumer"); }