@Override
    public Object pageListServiceDetail(String namespaceId, String groupName, String serviceName, int pageNo,
            int pageSize) throws NacosException {
        List<ServiceDetailInfo> result = new ArrayList<>();
        Collection<Service> services = patternServices(namespaceId, groupName, serviceName);
        services = doPage(services, pageNo - 1, pageSize);
        for (Service each : services) {
            ServiceDetailInfo serviceDetailInfo = new ServiceDetailInfo();
            serviceDetailInfo.setServiceName(each.getName());
            serviceDetailInfo.setGroupName(each.getGroup());
            ServiceMetadata serviceMetadata = metadataManager.getServiceMetadata(each).orElseGet(ServiceMetadata::new);
            serviceDetailInfo.setMetadata(serviceMetadata.getExtendData());
            serviceDetailInfo.setClusterMap(getClusterMap(each));
            result.add(serviceDetailInfo);
        }
        return result;
    }
@Test
    void testPageListServiceDetail() {
        try {
            ServiceMetadata metadata = new ServiceMetadata();
            Mockito.when(metadataManager.getServiceMetadata(Mockito.any())).thenReturn(Optional.of(metadata));
            
            Instance instance = new Instance();
            instance.setServiceName("C");
            instance.setClusterName("D");
            List<Instance> instances = Collections.singletonList(instance);
            ServiceInfo serviceInfo = new ServiceInfo();
            serviceInfo.setHosts(instances);
            Mockito.when(serviceStorage.getData(Mockito.any())).thenReturn(serviceInfo);
            
            List<ServiceDetailInfo> result = (List<ServiceDetailInfo>) catalogServiceV2Impl.pageListServiceDetail("A", "B", "C", 1, 10);
            
            assertEquals(1, result.size());
        } catch (NacosException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }