From 00a419aff34f886935f543714fa406146e9d3437 Mon Sep 17 00:00:00 2001 From: jaecheol sim Date: Wed, 13 Dec 2023 16:32:57 +0900 Subject: [PATCH] =?UTF-8?q?=20#=20fix:=20productService=EC=97=90=EC=84=9C?= =?UTF-8?q?=20securityUtil=EC=9D=84=20=EC=82=AC=EC=9A=A9=ED=95=98=EA=B8=B0?= =?UTF-8?q?=20=EC=9C=84=ED=95=B4=20Mock=EC=84=A4=EC=A0=95=EC=9D=84=20?= =?UTF-8?q?=ED=95=B4=EC=A4=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/product/unit/service/ProductServiceTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/com/fc/shimpyo_be/domain/product/unit/service/ProductServiceTest.java b/src/test/java/com/fc/shimpyo_be/domain/product/unit/service/ProductServiceTest.java index 2daf535b..ce5fd2fa 100644 --- a/src/test/java/com/fc/shimpyo_be/domain/product/unit/service/ProductServiceTest.java +++ b/src/test/java/com/fc/shimpyo_be/domain/product/unit/service/ProductServiceTest.java @@ -19,8 +19,10 @@ import com.fc.shimpyo_be.domain.product.util.ProductMapper; import com.fc.shimpyo_be.domain.room.dto.response.RoomResponse; import com.fc.shimpyo_be.domain.room.entity.Room; +import com.fc.shimpyo_be.global.util.SecurityUtil; import java.util.List; import java.util.Optional; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -34,6 +36,9 @@ @ExtendWith(MockitoExtension.class) class ProductServiceTest { + @Mock + private SecurityUtil securityUtil; + @Mock private ProductRepository productRepository; @@ -44,6 +49,10 @@ class ProductServiceTest { @InjectMocks private ProductService productService; + @BeforeEach + void init() { + given(securityUtil.getNullableCurrentMemberId()).willReturn(null); + } @Test void getProducts() {