@GetMapping("/list")
    @TpsControl(pointName = "NamingServiceSubscribe", name = "HttpNamingServiceSubscribe")
    @Secured(action = ActionTypes.READ)
    @ExtractorManager.Extractor(httpExtractor = NamingInstanceListHttpParamExtractor.class)
    public Result<ServiceInfo> list(
            @RequestParam(value = "namespaceId", defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
            @RequestParam(value = "groupName", defaultValue = Constants.DEFAULT_GROUP) String groupName,
            @RequestParam("serviceName") String serviceName,
            @RequestParam(value = "clusterName", defaultValue = StringUtils.EMPTY) String clusterName,
            @RequestParam(value = "ip", defaultValue = StringUtils.EMPTY) String ip,
            @RequestParam(value = "port", defaultValue = "0") Integer port,
            @RequestParam(value = "healthyOnly", defaultValue = "false") Boolean healthyOnly,
            @RequestParam(value = "app", defaultValue = StringUtils.EMPTY) String app,
            @RequestHeader(value = HttpHeaderConsts.USER_AGENT_HEADER, required = false) String userAgent,
            @RequestHeader(value = HttpHeaderConsts.CLIENT_VERSION_HEADER, required = false) String clientVersion) {
        if (StringUtils.isEmpty(userAgent)) {
            userAgent = StringUtils.defaultIfEmpty(clientVersion, StringUtils.EMPTY);
        }
        String compositeServiceName = NamingUtils.getGroupedName(serviceName, groupName);
        Subscriber subscriber = new Subscriber(ip + ":" + port, userAgent, app, ip, namespaceId, compositeServiceName,
                port, clusterName);
        return Result.success(instanceServiceV2.listInstance(namespaceId, compositeServiceName, subscriber, clusterName,
                healthyOnly));
    }
@Test
    void listInstance() throws Exception {
        
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setName("serviceInfo");
        
        when(instanceServiceV2.listInstance(eq(TEST_NAMESPACE), eq(TEST_SERVICE_NAME), any(), eq(TEST_CLUSTER_NAME), eq(false))).thenReturn(
                serviceInfo);
        
        Result<ServiceInfo> result = instanceControllerV2.list(TEST_NAMESPACE, "DEFAULT_GROUP", "test-service", TEST_CLUSTER_NAME, TEST_IP,
                9999, false, "", "", "");
        
        verify(instanceServiceV2).listInstance(eq(TEST_NAMESPACE), eq(TEST_SERVICE_NAME), any(), eq(TEST_CLUSTER_NAME), eq(false));
        
        assertEquals(ErrorCode.SUCCESS.getCode(), result.getCode());
        assertEquals(serviceInfo.getName(), result.getData().getName());
    }