@GetMapping
    @Secured(resource = Constants.LISTENER_CONTROLLER_PATH, action = ActionTypes.READ, signType = SignType.CONFIG)
    public GroupkeyListenserStatus getAllSubClientConfigByIp(@RequestParam("ip") String ip,
            @RequestParam(value = "all", required = false) boolean all,
            @RequestParam(value = "tenant", required = false) String tenant,
            @RequestParam(value = "sampleTime", required = false, defaultValue = "1") int sampleTime, ModelMap modelMap) {
        SampleResult collectSampleResult = configSubService.getCollectSampleResultByIp(ip, sampleTime);
        GroupkeyListenserStatus gls = new GroupkeyListenserStatus();
        gls.setCollectStatus(200);
        Map<String, String> configMd5Status = new HashMap<>(100);
        if (collectSampleResult.getLisentersGroupkeyStatus() == null) {
            return gls;
        }
        Map<String, String> status = collectSampleResult.getLisentersGroupkeyStatus();
        for (Map.Entry<String, String> config : status.entrySet()) {
            if (!StringUtils.isBlank(tenant) && config.getKey().contains(tenant)) {
                configMd5Status.put(config.getKey(), config.getValue());
                continue;
            }
            // Get common config default value, if want to get all config, you need to add "all".
            if (all) {
                configMd5Status.put(config.getKey(), config.getValue());
            } else {
                String[] configKeys = GroupKey2.parseKey(config.getKey());
                if (StringUtils.isBlank(configKeys[2])) {
                    configMd5Status.put(config.getKey(), config.getValue());
                }
            }
        }
        gls.setLisentersGroupkeyStatus(configMd5Status);
        return gls;
    }
@Test
    void testGetAllSubClientConfigByIp() throws Exception {
        
        SampleResult sampleResult = new SampleResult();
        Map<String, String> map = new HashMap<>();
        map.put("test", "test");
        sampleResult.setLisentersGroupkeyStatus(map);
        when(configSubService.getCollectSampleResultByIp("localhost", 1)).thenReturn(sampleResult);
        
        MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.get(Constants.LISTENER_CONTROLLER_PATH).param("ip", "localhost")
                .param("all", "true").param("tenant", "test").param("sampleTime", "1");
        
        String actualValue = mockmvc.perform(builder).andReturn().getResponse().getContentAsString();
        GroupkeyListenserStatus groupkeyListenserStatus = JacksonUtils.toObj(actualValue, GroupkeyListenserStatus.class);
        Map<String, String> resultMap = groupkeyListenserStatus.getLisentersGroupkeyStatus();
        
        assertEquals(map.get("test"), resultMap.get("test"));
        
    }