springboot怎么啟動(dòng)測(cè)試?
package io.geekidea.fastspringboot.test;import lombok.extern.slf4j.Slf4j;import org.junit.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.data.redis.core.RedisTemplate;/** * @author MrLiu * @date 2018/11/10 */@Slf4jpublic class TestRedisTemplate extends BaseTest{ @Autowired private RedisTemplate redisTemplate; @Test public void test(){ redisTemplate.opsForValue().set("hello","Hello Redis..."); Object hello = 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