| | |
| | | */ |
| | | 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; |
| | |
| | | public void testNoticeTask() throws IOException, InterruptedException { |
| | | LocalCache.save("name","jyy",1000*3); |
| | | System.out.println("放入对象"); |
| | | Assert.assertNotNull(LocalCache.get("name")); |
| | | Assert.assertNotNull(LocalCache.get("name",new TypeReference<SysUsers>(){})); |
| | | Thread.sleep(1000*5); |
| | | Assert.assertNull(LocalCache.get("name")); |
| | | Assert.assertNull(LocalCache.get("name",new TypeReference<SysUsers>(){})); |
| | | } |
| | | |
| | | } |