src/test/TestRedisConnection.java

(完整代码) 680B

import cn.pzhu.pserson.PsersonApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = PsersonApplication.class)
@RunWith(SpringRunner.class)
public class TestRedisConnection {


  @Autowired
  RedisTemplate redisTemplate;


  @Test
  public void testReid(){
    redisTemplate.opsForValue().set("1","1");
    System.out.println(redisTemplate.opsForValue().get("1"));
  }

}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。