forked from solid-connection/solid-connect-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisConnectionTest.java
More file actions
30 lines (23 loc) · 961 Bytes
/
RedisConnectionTest.java
File metadata and controls
30 lines (23 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.example.solidconnection.database;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import static org.assertj.core.api.Assertions.assertThat;
@Disabled
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class RedisConnectionTest {
@Autowired
private RedisTemplate<String, String> redisTemplate;
@DisplayName("레디스 연결 및 작동 테스트")
@Test
void connectRedis() {
String key = "test-key";
String expectedValue = "test-value";
redisTemplate.opsForValue().set(key, expectedValue);
String actualValue = redisTemplate.opsForValue().get(key);
assertThat(actualValue).isEqualTo(expectedValue);
}
}