File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1- package com .back .api ;
1+ package com .back .fixture ;
22
33import com .back .global .security .CustomUserDetails ;
44import org .springframework .security .access .prepost .PreAuthorize ;
Original file line number Diff line number Diff line change 1+ package com .back .global .config ;
2+
3+ import org .junit .jupiter .api .Test ;
4+ import org .springframework .beans .factory .annotation .Autowired ;
5+ import org .springframework .boot .test .context .SpringBootTest ;
6+ import org .springframework .data .redis .core .StringRedisTemplate ;
7+ import org .springframework .test .context .ActiveProfiles ;
8+
9+ import static org .assertj .core .api .Assertions .assertThat ;
10+
11+ @ SpringBootTest
12+ @ ActiveProfiles ("test" )
13+ class RedisConnectionTest {
14+
15+ @ Autowired
16+ private StringRedisTemplate redisTemplate ;
17+
18+ @ Test
19+ void redisShouldStoreAndGetValue () {
20+ // given
21+ String key = "test:key" ;
22+ String value = "hello" ;
23+
24+ // when
25+ redisTemplate .opsForValue ().set (key , value );
26+ String result = redisTemplate .opsForValue ().get (key );
27+
28+ // then
29+ assertThat (result ).isEqualTo (value );
30+ }
31+ }
Original file line number Diff line number Diff line change 1- package com .back ;
1+ package com .back . global . security ;
22
3- import com .back .global .security .JwtTokenProvider ;
43import org .junit .jupiter .api .DisplayName ;
54import org .junit .jupiter .api .Test ;
65import org .springframework .beans .factory .annotation .Autowired ;
You can’t perform that action at this time.
0 commit comments