@Override
    public String getConfigAndSignListener(String dataId, String group, long timeoutMs, Listener listener)
            throws NacosException {
        group = StringUtils.isBlank(group) ? Constants.DEFAULT_GROUP : group.trim();
        ConfigResponse configResponse = worker.getAgent()
                .queryConfig(dataId, group, worker.getAgent().getTenant(), timeoutMs, false);
        String content = configResponse.getContent();
        String encryptedDataKey = configResponse.getEncryptedDataKey();
        worker.addTenantListenersWithContent(dataId, group, content, encryptedDataKey,
                Collections.singletonList(listener));
        
        // get a decryptContent, fix https://github.com/alibaba/nacos/issues/7039
        ConfigResponse cr = new ConfigResponse();
        cr.setDataId(dataId);
        cr.setGroup(group);
        cr.setContent(content);
        cr.setEncryptedDataKey(encryptedDataKey);
        configFilterChainManager.doFilter(null, cr);
        return cr.getContent();
    }
@Test
    void testGetConfigAndSignListener() throws NacosException {
        final String dataId = "1";
        final String group = "2";
        final String tenant = "";
        final String content = "123";
        final int timeout = 3000;
        final Listener listener = new Listener() {
            @Override
            public Executor getExecutor() {
                return null;
            }
            
            @Override
            public void receiveConfigInfo(String configInfo) {
            
            }
        };
        
        final NacosClientProperties properties = NacosClientProperties.PROTOTYPE.derive(new Properties());
        Mockito.when(mockWoker.getAgent()).thenReturn(new ConfigTransportClient(properties, new ServerListManager()) {
            @Override
            public void startInternal() throws NacosException {
                // NOOP
            }
            
            @Override
            public String getName() {
                return "TestConfigTransportClient";
            }
            
            @Override
            public void notifyListenConfig() {
                // NOOP
            }
            
            @Override
            public void executeConfigListen() {
                // NOOP
            }
            
            @Override
            public void removeCache(String dataId, String group) {
                // NOOP
            }
            
            @Override
            public ConfigResponse queryConfig(String dataId, String group, String tenant, long readTimeous, boolean notify)
                    throws NacosException {
                ConfigResponse configResponse = new ConfigResponse();
                configResponse.setContent(content);
                configResponse.setDataId(dataId);
                configResponse.setGroup(group);
                configResponse.setTenant(tenant);
                return configResponse;
            }
            
            @Override
            public boolean publishConfig(String dataId, String group, String tenant, String appName, String tag, String betaIps,
                    String content, String encryptedDataKey, String casMd5, String type) throws NacosException {
                return false;
            }
            
            @Override
            public boolean removeConfig(String dataId, String group, String tenant, String tag) throws NacosException {
                return false;
            }
        });
        
        final String config = nacosConfigService.getConfigAndSignListener(dataId, group, timeout, listener);
        assertEquals(content, config);
        
        Mockito.verify(mockWoker, Mockito.times(1)).addTenantListenersWithContent(dataId, group, content, null, Arrays.asList(listener));
    }