diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b11c7d..bdc530d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,6 @@ jobs: build: runs-on: ubuntu-latest - env: - TESTCONTAINERS_RYUK_DISABLED: true - steps: - name: Checkout code uses: actions/checkout@v4 @@ -32,4 +29,4 @@ jobs: run: ./gradlew build -x test - name: Run tests - run: ./gradlew test \ No newline at end of file + run: ./gradlew test diff --git a/src/test/kotlin/com/wafflestudio/spring2025/CommentIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/CommentIntegrationTest.kt index 4870031..1baa95c 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/CommentIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/CommentIntegrationTest.kt @@ -9,6 +9,7 @@ import com.wafflestudio.spring2025.comment.dto.core.CommentDto import com.wafflestudio.spring2025.comment.repository.CommentRepository import com.wafflestudio.spring2025.helper.DataGenerator import com.wafflestudio.spring2025.helper.QueryCounter +import com.wafflestudio.spring2025.helper.mock.MockRedis import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired @@ -17,6 +18,7 @@ import org.springframework.boot.test.context.SpringBootTest import org.springframework.data.repository.findByIdOrNull import org.springframework.http.MediaType import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get @@ -30,6 +32,7 @@ import org.testcontainers.junit.jupiter.Testcontainers @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) class CommentIntegrationTest @Autowired constructor( diff --git a/src/test/kotlin/com/wafflestudio/spring2025/CourseFetchIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/CourseFetchIntegrationTest.kt index 2651186..0ad101f 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/CourseFetchIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/CourseFetchIntegrationTest.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import com.wafflestudio.spring2025.common.enum.Semester import com.wafflestudio.spring2025.course.repository.CourseRepository import com.wafflestudio.spring2025.helper.DataGenerator +import com.wafflestudio.spring2025.helper.mock.MockRedis import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertNotNull @@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post import org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath @@ -25,6 +27,7 @@ import org.testcontainers.junit.jupiter.Testcontainers @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) @Disabled("실제 서울대 사이트를 호출하므로 수동으로 실행") class CourseFetchIntegrationTest @Autowired diff --git a/src/test/kotlin/com/wafflestudio/spring2025/PostIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/PostIntegrationTest.kt index 4990a60..c02dd13 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/PostIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/PostIntegrationTest.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import com.wafflestudio.spring2025.board.model.Board import com.wafflestudio.spring2025.helper.DataGenerator import com.wafflestudio.spring2025.helper.QueryCounter +import com.wafflestudio.spring2025.helper.mock.MockRedis import com.wafflestudio.spring2025.post.dto.CreatePostRequest import com.wafflestudio.spring2025.post.dto.PostPagingResponse import com.wafflestudio.spring2025.post.dto.UpdatePostRequest @@ -17,6 +18,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.context.SpringBootTest import org.springframework.http.MediaType import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get @@ -30,6 +32,7 @@ import org.testcontainers.junit.jupiter.Testcontainers @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) class PostIntegrationTest @Autowired constructor( diff --git a/src/test/kotlin/com/wafflestudio/spring2025/PostLikeIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/PostLikeIntegrationTest.kt index 84801da..dd232e2 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/PostLikeIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/PostLikeIntegrationTest.kt @@ -2,12 +2,14 @@ package com.wafflestudio.spring2025 import com.fasterxml.jackson.databind.ObjectMapper import com.wafflestudio.spring2025.helper.DataGenerator +import com.wafflestudio.spring2025.helper.mock.MockRedis import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest import org.springframework.http.MediaType import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get @@ -21,6 +23,7 @@ import java.util.concurrent.Executors @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) class PostLikeIntegrationTest @Autowired constructor( diff --git a/src/test/kotlin/com/wafflestudio/spring2025/RealCourseIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/RealCourseIntegrationTest.kt index e426ad0..15bff95 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/RealCourseIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/RealCourseIntegrationTest.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import com.wafflestudio.spring2025.common.enum.Semester import com.wafflestudio.spring2025.course.repository.CourseRepository import com.wafflestudio.spring2025.helper.DataGenerator +import com.wafflestudio.spring2025.helper.mock.MockRedis import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Assertions.assertTrue @@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get @@ -31,6 +33,7 @@ import org.testcontainers.junit.jupiter.Testcontainers @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) @Disabled("실제 서울대 사이트를 호출하므로 수동으로 실행") class RealCourseIntegrationTest @Autowired diff --git a/src/test/kotlin/com/wafflestudio/spring2025/TimetableIntegrationTest.kt b/src/test/kotlin/com/wafflestudio/spring2025/TimetableIntegrationTest.kt index 541ba0b..3032144 100644 --- a/src/test/kotlin/com/wafflestudio/spring2025/TimetableIntegrationTest.kt +++ b/src/test/kotlin/com/wafflestudio/spring2025/TimetableIntegrationTest.kt @@ -6,6 +6,7 @@ import com.wafflestudio.spring2025.course.crawling.ClassPlaceAndTime import com.wafflestudio.spring2025.course.crawling.DayOfWeek import com.wafflestudio.spring2025.course.dto.CourseSearchResponse import com.wafflestudio.spring2025.helper.DataGenerator +import com.wafflestudio.spring2025.helper.mock.MockRedis import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -14,6 +15,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.context.SpringBootTest import org.springframework.http.MediaType import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get @@ -28,6 +30,7 @@ import java.util.concurrent.Executors @ActiveProfiles("test") @Testcontainers @AutoConfigureMockMvc +@ContextConfiguration(initializers = [MockRedis::class]) class TimetableIntegrationTest @Autowired constructor(