public static String getConsumerAddressNum(ConsumerModel consumerModel) {
        int num = 0;
        Object object = consumerModel.getServiceMetadata().getAttribute(CommonConstants.CURRENT_CLUSTER_INVOKER_KEY);
        Map<Registry, MigrationInvoker<?>> invokerMap;
        List<String> nums = new LinkedList<>();
        if (object instanceof Map) {
            invokerMap = (Map<Registry, MigrationInvoker<?>>) object;
            for (Map.Entry<Registry, MigrationInvoker<?>> entry : invokerMap.entrySet()) {
                URL registryUrl = entry.getKey().getUrl();
                boolean isServiceDiscovery = UrlUtils.isServiceDiscoveryURL(registryUrl);
                String protocol = isServiceDiscovery
                        ? registryUrl.getParameter(RegistryConstants.REGISTRY_KEY)
                        : registryUrl.getProtocol();
                MigrationInvoker<?> migrationInvoker = entry.getValue();
                MigrationStep migrationStep = migrationInvoker.getMigrationStep();
                String interfaceSize = Optional.ofNullable(migrationInvoker.getInvoker())
                        .map(ClusterInvoker::getDirectory)
                        .map(Directory::getAllInvokers)
                        .map(List::size)
                        .map(String::valueOf)
                        .orElse("-");
                String applicationSize = Optional.ofNullable(migrationInvoker.getServiceDiscoveryInvoker())
                        .map(ClusterInvoker::getDirectory)
                        .map(Directory::getAllInvokers)
                        .map(List::size)
                        .map(String::valueOf)
                        .orElse("-");
                String step;
                String size;
                switch (migrationStep) {
                    case APPLICATION_FIRST:
                        step = "AF";
                        size = "I-" + interfaceSize + ",A-" + applicationSize;
                        break;
                    case FORCE_INTERFACE:
                        step = "I";
                        size = interfaceSize;
                        break;
                    default:
                        step = "A";
                        size = applicationSize;
                        break;
                }
                // zookeeper-AF(I-10,A-0)
                // zookeeper-I(10)
                // zookeeper-A(10)
                nums.add(protocol + "-" + step + "(" + size + ")");
            }
        }
        // zookeeper-AF(I-10,A-0)/nacos-I(10)
        return String.join("/", nums.toArray(new String[0]));
    }
@Test
    void testGetConsumerAddressNum() {
        ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class);
        ServiceMetadata serviceMetadata = Mockito.mock(ServiceMetadata.class);
        Mockito.when(consumerModel.getServiceMetadata()).thenReturn(serviceMetadata);
        String registry1 =
                "service-discovery-registry://127.0.0.1:2181/org.apache.dubbo.registry.RegistryService?application=dubbo-demo-api-provider&dubbo=2.0.2&pid=66099&registry=zookeeper&timestamp=1654588337653";
        String registry2 =
                "zookeeper://127.0.0.1:2181/org.apache.dubbo.registry.RegistryService?application=dubbo-demo-api-provider&dubbo=2.0.2&pid=66099&timestamp=1654588337653";
        String registry3 =
                "nacos://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-demo-api-provider&dubbo=2.0.2&pid=66099&timestamp=1654588337653";
        Map<Registry, MigrationInvoker<?>> invokerMap = new LinkedHashMap<>();
        {
            Registry registry = Mockito.mock(Registry.class);
            Mockito.when(registry.getUrl()).thenReturn(URL.valueOf(registry1));
            MigrationInvoker<?> migrationInvoker = Mockito.mock(MigrationInvoker.class);
            Mockito.when(migrationInvoker.getMigrationStep()).thenReturn(MigrationStep.FORCE_APPLICATION);
            ClusterInvoker serviceDiscoveryInvoker = Mockito.mock(ClusterInvoker.class);
            Mockito.when(migrationInvoker.getServiceDiscoveryInvoker()).thenReturn(serviceDiscoveryInvoker);
            Directory<?> sdDirectory = Mockito.mock(Directory.class);
            Mockito.when(serviceDiscoveryInvoker.getDirectory()).thenReturn(sdDirectory);
            List sdInvokers = Mockito.mock(List.class);
            Mockito.when(sdDirectory.getAllInvokers()).thenReturn(sdInvokers);
            Mockito.when(sdInvokers.size()).thenReturn(5);
            invokerMap.put(registry, migrationInvoker);
        }

        {
            Registry registry = Mockito.mock(Registry.class);
            Mockito.when(registry.getUrl()).thenReturn(URL.valueOf(registry2));
            MigrationInvoker<?> migrationInvoker = Mockito.mock(MigrationInvoker.class);
            Mockito.when(migrationInvoker.getMigrationStep()).thenReturn(MigrationStep.APPLICATION_FIRST);
            ClusterInvoker serviceDiscoveryInvoker = Mockito.mock(ClusterInvoker.class);
            Mockito.when(migrationInvoker.getServiceDiscoveryInvoker()).thenReturn(serviceDiscoveryInvoker);
            Directory<?> sdDirectory = Mockito.mock(Directory.class);
            Mockito.when(serviceDiscoveryInvoker.getDirectory()).thenReturn(sdDirectory);
            List sdInvokers = Mockito.mock(List.class);
            Mockito.when(sdDirectory.getAllInvokers()).thenReturn(sdInvokers);
            Mockito.when(sdInvokers.size()).thenReturn(0);

            ClusterInvoker invoker = Mockito.mock(ClusterInvoker.class);
            Mockito.when(migrationInvoker.getInvoker()).thenReturn(invoker);
            Directory<?> directory = Mockito.mock(Directory.class);
            Mockito.when(invoker.getDirectory()).thenReturn(directory);
            List invokers = Mockito.mock(List.class);
            Mockito.when(directory.getAllInvokers()).thenReturn(invokers);
            Mockito.when(invokers.size()).thenReturn(10);
            invokerMap.put(registry, migrationInvoker);
        }

        {
            Registry registry = Mockito.mock(Registry.class);
            Mockito.when(registry.getUrl()).thenReturn(URL.valueOf(registry3));
            MigrationInvoker<?> migrationInvoker = Mockito.mock(MigrationInvoker.class);
            Mockito.when(migrationInvoker.getMigrationStep()).thenReturn(MigrationStep.FORCE_INTERFACE);
            ClusterInvoker invoker = Mockito.mock(ClusterInvoker.class);
            Mockito.when(migrationInvoker.getInvoker()).thenReturn(invoker);
            Directory<?> directory = Mockito.mock(Directory.class);
            Mockito.when(invoker.getDirectory()).thenReturn(directory);
            List invokers = Mockito.mock(List.class);
            Mockito.when(directory.getAllInvokers()).thenReturn(invokers);
            Mockito.when(invokers.size()).thenReturn(10);
            invokerMap.put(registry, migrationInvoker);
        }

        Mockito.when(serviceMetadata.getAttribute("currentClusterInvoker")).thenReturn(invokerMap);

        assertEquals(
                "zookeeper-A(5)/zookeeper-AF(I-10,A-0)/nacos-I(10)",
                ServiceCheckUtils.getConsumerAddressNum(consumerModel));
    }