From c07afbb00c3349ed22c8caa3e3ce1aa40f70926c Mon Sep 17 00:00:00 2001 From: Donghoon Lee Date: Fri, 29 Nov 2024 11:30:57 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20fix:=20redis=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=A0=9C=EA=B1=B0=20(#985)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/build.gradle | 1 - .../src/test/java/reviewme/api/ApiTest.java | 19 +------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 99bb632fb..4981440a7 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -35,7 +35,6 @@ dependencies { implementation 'io.micrometer:micrometer-registry-prometheus' implementation 'org.flywaydb:flyway-core' implementation 'org.flywaydb:flyway-mysql' - implementation 'org.springframework.boot:spring-boot-starter-data-redis' runtimeOnly 'com.h2database:h2' runtimeOnly 'com.mysql:mysql-connector-j' diff --git a/backend/src/test/java/reviewme/api/ApiTest.java b/backend/src/test/java/reviewme/api/ApiTest.java index 682a2ea18..20d57db83 100644 --- a/backend/src/test/java/reviewme/api/ApiTest.java +++ b/backend/src/test/java/reviewme/api/ApiTest.java @@ -1,7 +1,5 @@ package reviewme.api; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.BDDMockito.given; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration; import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyHeaders; import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyUris; @@ -17,11 +15,8 @@ import org.apache.http.HttpHeaders; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; import org.springframework.http.MediaType; import org.springframework.restdocs.RestDocumentationContextProvider; import org.springframework.restdocs.RestDocumentationExtension; @@ -34,8 +29,8 @@ import reviewme.highlight.controller.HighlightController; import reviewme.highlight.service.HighlightService; import reviewme.review.controller.ReviewController; -import reviewme.review.service.ReviewGatheredLookupService; import reviewme.review.service.ReviewDetailLookupService; +import reviewme.review.service.ReviewGatheredLookupService; import reviewme.review.service.ReviewListLookupService; import reviewme.review.service.ReviewRegisterService; import reviewme.review.service.ReviewSummaryService; @@ -78,12 +73,6 @@ public abstract class ApiTest { @MockBean protected ReviewGroupLookupService reviewGroupLookupService; - @MockBean - protected RedisTemplate redisTemplate; - - @Mock - protected ValueOperations valueOperations; - @MockBean protected ReviewSummaryService reviewSummaryService; @@ -111,12 +100,6 @@ public abstract class ApiTest { } }; - @BeforeEach - void setUpRedisConfig() { - given(redisTemplate.opsForValue()).willReturn(valueOperations); - given(valueOperations.increment(anyString())).willReturn(1L); - } - @BeforeEach void setUpRestDocs(WebApplicationContext context, RestDocumentationContextProvider provider) { UriModifyingOperationPreprocessor uriModifier = modifyUris()