File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/test/java/org/mvnsearch Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .junit .Test ;
4
4
import org .junit .runner .RunWith ;
5
+ import org .springframework .beans .factory .annotation .Autowired ;
5
6
import org .springframework .boot .test .SpringApplicationConfiguration ;
7
+ import org .springframework .boot .test .context .SpringBootTest ;
8
+ import org .springframework .data .redis .core .RedisTemplate ;
6
9
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
10
+ import org .springframework .test .context .junit4 .SpringRunner ;
7
11
8
12
/**
9
13
* thymeleaf applicaiton test
10
14
*
11
15
* @author linux_china
12
16
*/
13
- @ RunWith (SpringJUnit4ClassRunner .class )
14
- @ SpringApplicationConfiguration ( classes = ThymeLeafDemoApplication . class )
17
+ @ RunWith (SpringRunner .class )
18
+ @ SpringBootTest ( webEnvironment = SpringBootTest . WebEnvironment . NONE )
15
19
public class ThymeLeafDemoApplicationTest {
20
+ @ Autowired
21
+ private RedisTemplate <String , String > redisTemplate ;
16
22
17
23
@ Test
18
24
public void contextLoads () {
19
-
25
+ redisTemplate .boundValueOps ("nick" ).set ("Jacky" );
26
+ System .out .println ("nick:" + redisTemplate .boundValueOps ("nick" ).get ());
20
27
}
21
28
22
29
}
You can’t perform that action at this time.
0 commit comments