### Question:
MetadataReportService { public void publishConsumer(URL consumerURL) throws RpcException { consumerURL = consumerURL.removeParameters(Constants.PID_KEY, Constants.TIMESTAMP_KEY, Constants.BIND_IP_KEY, Constants.BIND_PORT_KEY, Constants.TIMESTAMP_KEY); metadataReport.storeConsumerMetadata(new MetadataIdentifier(consumerURL.getServiceInterface(), consumerURL.getParameter(Constants.VERSION_KEY), consumerURL.getParameter(Constants.GROUP_KEY),Constants.CONSUMER_SIDE, consumerURL.getParameter(Constants.APPLICATION_KEY)), consumerURL.getParameters()); } MetadataReportService(URL metadataReportURL); static MetadataReportService instance(Supplier<URL> metadataReportUrl); void publishProvider(URL providerUrl); void publishConsumer(URL consumerURL);  }### Answer:
@Test public void testPublishConsumer() throws InterruptedException { URL publishUrl = URL.valueOf("dubbo: metadataReportService1.publishConsumer(publishUrl); Thread.sleep(300); Assertions.assertTrue(metadataReportService1.metadataReport instanceof JTestMetadataReport4Test); JTestMetadataReport4Test jTestMetadataReport4Test = (JTestMetadataReport4Test) metadataReportService1.metadataReport; Assertions.assertTrue(jTestMetadataReport4Test.store.containsKey(JTestMetadataReport4Test.getConsumerKey(publishUrl))); String value = jTestMetadataReport4Test.store.get(JTestMetadataReport4Test.getConsumerKey(publishUrl)); Gson gson = new Gson(); Map<String, String> map = gson.fromJson(value, Map.class); Assertions.assertEquals(map.get("application"), "vicpubconsumer"); Assertions.assertEquals(map.get("version"), "1.0.x"); }