mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
26 lines
697 B
Java
26 lines
697 B
Java
package com.java2nb.testDemo;
|
|
|
|
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;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController()
|
|
@RunWith(SpringRunner.class)
|
|
@SpringBootTest
|
|
public class TestDemo {
|
|
@Autowired
|
|
RedisTemplate redisTemplate;
|
|
|
|
@Test
|
|
public void test() {
|
|
redisTemplate.opsForValue().set("a", "b");
|
|
System.out.println(redisTemplate.opsForValue().get("a"));
|
|
}
|
|
|
|
;
|
|
}
|