packageio.geekidea.fastspringboot.test;
importlombok.extern.slf4j.Slf4j;
importorg.junit.Test;
importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.data.redis.core.RedisTemplate;
/**
*@authorMrLiu
*@date2018/11/10
*/
@Slf4j
publicclassTestRedisTemplateextendsBaseTest{
@Autowired
privateRedisTemplateredisTemplate;
@Test
publicvoidtest(){
redisTemplate.opsForValue().set("hello","HelloRedis...");
Objecthello=redisTemplate.opsForValue().get("hello");
log.debug("hello="+hello);
}
}
參考:
https://github.com/geekidea/fast-spring-boot/blob/master/src/test/java/io/geekidea/fastspringboot/test/TestRedisTemplate.java