Skip to content

Commit

Permalink
[UNI-255] fix: redis 컨테이너 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks committed Feb 20, 2025
1 parent 0b00fb5 commit 3194a24
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uniro_backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ dependencies {
testImplementation 'org.testcontainers:junit-jupiter:1.19.5'
testImplementation 'org.testcontainers:jdbc:1.19.5'
testImplementation 'org.testcontainers:mysql:1.19.5'
testImplementation("org.testcontainers:redis:1.19.4")
testImplementation("redis.clients:jedis:5.1.0") // Redis 클라이언트

// jwt
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.AuditReaderFactory;
import org.hibernate.envers.query.AuditEntity;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand All @@ -27,7 +29,9 @@
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlGroup;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

import com.softeer5.uniro_backend.admin.entity.RevInfo;
import com.softeer5.uniro_backend.admin.test_repository.RevInfoTestRepository;
Expand Down Expand Up @@ -56,6 +60,20 @@
})
class AdminServiceTest {

private static final GenericContainer<?> redisContainer =
new GenericContainer<>(DockerImageName.parse("redis:7.0.12"))
.withExposedPorts(6379);

@BeforeEach
static void setUp() {
redisContainer.start();
}

@AfterEach
static void tearDown() {
redisContainer.stop();
}

@Autowired
private AdminService adminService;

Expand Down

0 comments on commit 3194a24

Please sign in to comment.