void publishAll() {
        logger.info("start to publish all metadata.");
        this.doHandleMetadataCollection(allMetadataReports);
    }
@Test
    void testPublishAll() throws ClassNotFoundException {
        ThreadPoolExecutor reportCacheExecutor = (ThreadPoolExecutor) abstractMetadataReport.getReportCacheExecutor();

        assertTrue(abstractMetadataReport.store.isEmpty());
        assertTrue(abstractMetadataReport.allMetadataReports.isEmpty());
        String interfaceName = "org.apache.dubbo.metadata.store.InterfaceNameTestService";
        String version = "1.0.0";
        String group = null;
        String application = "vic";
        long completedTaskCount1 = reportCacheExecutor.getCompletedTaskCount();
        MetadataIdentifier providerMetadataIdentifier1 =
                storeProvider(abstractMetadataReport, interfaceName, version, group, application);
        await().until(() -> reportCacheExecutor.getCompletedTaskCount() > completedTaskCount1);
        assertEquals(1, abstractMetadataReport.allMetadataReports.size());
        assertTrue(((FullServiceDefinition) abstractMetadataReport.allMetadataReports.get(providerMetadataIdentifier1))
                .getParameters()
                .containsKey("testPKey"));

        long completedTaskCount2 = reportCacheExecutor.getCompletedTaskCount();
        MetadataIdentifier providerMetadataIdentifier2 =
                storeProvider(abstractMetadataReport, interfaceName, version + "_2", group + "_2", application);
        await().until(() -> reportCacheExecutor.getCompletedTaskCount() > completedTaskCount2);
        assertEquals(2, abstractMetadataReport.allMetadataReports.size());
        assertTrue(((FullServiceDefinition) abstractMetadataReport.allMetadataReports.get(providerMetadataIdentifier2))
                .getParameters()
                .containsKey("testPKey"));
        assertEquals(
                ((FullServiceDefinition) abstractMetadataReport.allMetadataReports.get(providerMetadataIdentifier2))
                        .getParameters()
                        .get("version"),
                version + "_2");

        Map<String, String> tmpMap = new HashMap<>();
        tmpMap.put("testKey", "value");
        long completedTaskCount3 = reportCacheExecutor.getCompletedTaskCount();
        MetadataIdentifier consumerMetadataIdentifier =
                storeConsumer(abstractMetadataReport, interfaceName, version + "_3", group + "_3", application, tmpMap);
        await().until(() -> reportCacheExecutor.getCompletedTaskCount() > completedTaskCount3);
        assertEquals(3, abstractMetadataReport.allMetadataReports.size());

        Map tmpMapResult = (Map) abstractMetadataReport.allMetadataReports.get(consumerMetadataIdentifier);
        assertEquals("9090", tmpMapResult.get("testPKey"));
        assertEquals("value", tmpMapResult.get("testKey"));
        assertEquals(3, abstractMetadataReport.store.size());

        abstractMetadataReport.store.clear();

        assertEquals(0, abstractMetadataReport.store.size());

        long completedTaskCount4 = reportCacheExecutor.getCompletedTaskCount();
        abstractMetadataReport.publishAll();
        await().until(() -> reportCacheExecutor.getCompletedTaskCount() > completedTaskCount4);

        assertEquals(3, abstractMetadataReport.store.size());

        String v = abstractMetadataReport.store.get(providerMetadataIdentifier1.getUniqueKey(KeyTypeEnum.UNIQUE_KEY));
        FullServiceDefinition data = JsonUtils.toJavaObject(v, FullServiceDefinition.class);
        checkParam(data.getParameters(), application, version);

        String v2 = abstractMetadataReport.store.get(providerMetadataIdentifier2.getUniqueKey(KeyTypeEnum.UNIQUE_KEY));
        data = JsonUtils.toJavaObject(v2, FullServiceDefinition.class);
        checkParam(data.getParameters(), application, version + "_2");

        String v3 = abstractMetadataReport.store.get(consumerMetadataIdentifier.getUniqueKey(KeyTypeEnum.UNIQUE_KEY));
        Map v3Map = JsonUtils.toJavaObject(v3, Map.class);
        checkParam(v3Map, application, version + "_3");
    }