@RequestMapping(value = "/{product}/{cluster}", method = RequestMethod.GET)
    public ResponseEntity<String> getCluster(@PathVariable String product, @PathVariable String cluster) {
        
        String productName = addressServerBuilderManager.generateProductName(product);
        String serviceName = addressServerBuilderManager.generateNacosServiceName(productName);
        String serviceWithoutGroup = NamingUtils.getServiceName(serviceName);
        String groupName = NamingUtils.getGroupName(serviceName);
        Optional<Service> service = ServiceManager.getInstance()
                .getSingletonIfExist(Constants.DEFAULT_NAMESPACE_ID, groupName, serviceWithoutGroup);
        if (!service.isPresent()) {
            return ResponseEntity.status(HttpStatus.NOT_FOUND).body("product=" + product + " not found.");
        }
        ClusterMetadata metadata = metadataManager.getServiceMetadata(service.get()).orElse(new ServiceMetadata())
                .getClusters().get(cluster);
        if (null == metadata) {
            return ResponseEntity.status(HttpStatus.NOT_FOUND)
                    .body("product=" + product + ",cluster=" + cluster + " not found.");
        }
        ServiceInfo serviceInfo = serviceStorage.getData(service.get());
        serviceInfo = ServiceUtil.selectInstances(serviceInfo, cluster, false);
        return ResponseEntity.status(HttpStatus.OK)
                .body(addressServerBuilderManager.generateResponseIps(serviceInfo.getHosts()));
    }
@Test
    void testGetCluster() throws Exception {
        
        final Service service = Service
                .newService(Constants.DEFAULT_NAMESPACE_ID, Constants.DEFAULT_GROUP, "nacos.as.default", false);
        ServiceMetadata serviceMetadata = new ServiceMetadata();
        serviceMetadata.getClusters().put("serverList", new ClusterMetadata());
        when(metadataManager.getServiceMetadata(service)).thenReturn(Optional.of(serviceMetadata));
        List<Instance> list = new ArrayList<>(2);
        list.add(new Instance());
        list.add(new Instance());
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setHosts(list);
        when(serviceStorage.getData(service)).thenReturn(serviceInfo);
        mockMvc.perform(get("/nacos/serverList")).andExpect(status().isOk());
    }