Skip to content

Commit eb71918

Browse files
committed
minor update
1 parent e4e6516 commit eb71918

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/test/java/org/mvnsearch/ThymeLeafDemoApplicationTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,28 @@
22

33
import org.junit.Test;
44
import org.junit.runner.RunWith;
5+
import org.springframework.beans.factory.annotation.Autowired;
56
import org.springframework.boot.test.SpringApplicationConfiguration;
7+
import org.springframework.boot.test.context.SpringBootTest;
8+
import org.springframework.data.redis.core.RedisTemplate;
69
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
10+
import org.springframework.test.context.junit4.SpringRunner;
711

812
/**
913
* thymeleaf applicaiton test
1014
*
1115
* @author linux_china
1216
*/
13-
@RunWith(SpringJUnit4ClassRunner.class)
14-
@SpringApplicationConfiguration(classes = ThymeLeafDemoApplication.class)
17+
@RunWith(SpringRunner.class)
18+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
1519
public class ThymeLeafDemoApplicationTest {
20+
@Autowired
21+
private RedisTemplate<String, String> redisTemplate;
1622

1723
@Test
1824
public void contextLoads() {
19-
25+
redisTemplate.boundValueOps("nick").set("Jacky");
26+
System.out.println("nick:" + redisTemplate.boundValueOps("nick").get());
2027
}
2128

2229
}

0 commit comments

Comments
 (0)