@@ -0,0 +1,3222 @@
+package com.alibaba.nacos.config.server.remote;%0A%0Aimport com.alibaba.nacos.api.config.remote.request.ConfigQueryRequest;%0Aimport com.alibaba.nacos.api.config.remote.response.ConfigQueryResponse;%0Aimport com.alibaba.nacos.api.exception.NacosException;%0Aimport com.alibaba.nacos.api.remote.request.RequestMeta;%0Aimport com.alibaba.nacos.config.server.model.CacheItem;%0Aimport com.alibaba.nacos.config.server.service.ConfigCacheService;%0Aimport com.alibaba.nacos.config.server.service.repository.PersistService;%0Aimport com.alibaba.nacos.config.server.utils.DiskUtil;%0Aimport com.alibaba.nacos.config.server.utils.GroupKey2;%0Aimport com.alibaba.nacos.config.server.utils.PropertyUtil;%0Aimport com.alibaba.nacos.sys.env.EnvUtil;%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.springframework.core.env.StandardEnvironment;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.util.ReflectionTestUtils;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport static com.alibaba.nacos.api.common.Constants.ENCODE;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@WebAppConfiguration%0Apublic class ConfigQueryRequestHandlerTest %7B%0A%0A    @InjectMocks%0A    private ConfigQueryRequestHandler configQueryRequestHandler;%0A    @Mock%0A    private PersistService persistService;%0A    @Mock%0A    private File file;%0A%0A%0A    @Before%0A    public void init() throws IOException %7B%0A        EnvUtil.setEnvironment(new StandardEnvironment());%0A        Mockito.mockStatic(ConfigCacheService.class);%0A        Mockito.mockStatic(PropertyUtil.class);%0A        Mockito.mockStatic(FileUtils.class);%0A        Mockito.mockStatic(DiskUtil.class);%0A        when(DiskUtil.targetFile(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(file);%0A        when(FileUtils.readFileToString(file,ENCODE)).thenReturn(%22content%22);%0A        when(file.exists()).thenReturn(true);%0A        ReflectionTestUtils.setField(configQueryRequestHandler, %22persistService%22, persistService);%0A    %7D%0A    @Test%0A    public void testHandle() throws IOException, NacosException %7B%0A        ConfigQueryRequest configQueryRequest=new ConfigQueryRequest();%0A        configQueryRequest.setDataId(%22dataId%22);%0A        configQueryRequest.setGroup(%22group%22);%0A        final String groupKey = GroupKey2%0A                .getKey(configQueryRequest.getDataId(), configQueryRequest.getGroup(), configQueryRequest.getTenant());%0A        when(ConfigCacheService.tryReadLock(groupKey)).thenReturn(1);%0A%0A        CacheItem cacheItem=new CacheItem(groupKey);%0A        cacheItem.setMd5(%221%22);%0A        cacheItem.setLastModifiedTs(1L);%0A        when(ConfigCacheService.getContentCache(Mockito.any())).thenReturn(cacheItem);%0A%0A        RequestMeta requestMeta = new RequestMeta();%0A        requestMeta.setClientIp(%22127.0.0.1%22);%0A        ConfigQueryResponse response = configQueryRequestHandler.handle(configQueryRequest, requestMeta);%0A        Assert.assertEquals(response.getContent(),%22content%22);%0A    %7D%0A%0A%0A%7D

Add unit tests for class ConfigQueryRequestHandler in nacos 2.0