|
@@ -0,0 +1,42 @@
|
|
|
+/**
|
|
|
+ * @author zhangyy
|
|
|
+ * @version 1.0
|
|
|
+ * @description: RedisTest
|
|
|
+ * @date 2024/9/10 13:47
|
|
|
+ */
|
|
|
+
|
|
|
+import com.hrsk.cloud.eg.Application;
|
|
|
+import com.hrsk.cloud.eg.infrastructure.utils.RedisUtil;
|
|
|
+import org.junit.Test;
|
|
|
+import org.junit.runner.RunWith;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author zhangyy
|
|
|
+ * @version 1.0
|
|
|
+ * @description: GenerateConfigTest
|
|
|
+ * @date 2024/9/9 15:13
|
|
|
+ */
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
+@SpringBootTest(classes = Application.class)
|
|
|
+public class RedisTest {
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private RedisUtil redisUtil;
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void setRedisUtil(){
|
|
|
+ redisUtil.set("key1", "value1");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getRedisUtil(){
|
|
|
+ System.out.println(redisUtil.get("key1"));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|