Helius
2022-05-27 4351e71d782741143a98f86f6648acd16689165f
zq-erp/src/test/java/com/matrix/LocalCacheTest.java
New file
@@ -0,0 +1,37 @@
/**
 * projectName: zq-erp
 * fileName: LocalCacheTest.java
 * packageName: com.matrix
 * date: 2021-10-25 14:03
 * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved.
 */
package com.matrix;
import com.alibaba.fastjson.TypeReference;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.init.LocalCache;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
/**
 * @version: V1.0
 * @author: JiangYouYao
 * @className: LocalCacheTest
 * @packageName: com.matrix
 * @description: LocalCache
 * @data: 2021-10-25 14:03
 **/
public class LocalCacheTest {
    @Test
    public void testNoticeTask() throws IOException, InterruptedException {
        LocalCache.save("name","jyy",1000*3);
        System.out.println("放入对象");
        Assert.assertNotNull(LocalCache.get("name",new TypeReference<SysUsers>(){}));
        Thread.sleep(1000*5);
        Assert.assertNull(LocalCache.get("name",new TypeReference<SysUsers>(){}));
    }
}