From 18513c6a7db99e51316586f95c7e9c88db1b3a07 Mon Sep 17 00:00:00 2001 From: woosung1223 Date: Thu, 8 Jun 2023 14:37:43 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=ED=94=84=EB=A1=9C=EB=8D=95=EC=85=98=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B8=ED=95=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cart/presentation/ExceptionStatusMapperTest.java | 3 ++- .../cart/presentation/controller/CartItemControllerTest.java | 2 +- .../cart/presentation/controller/ProductControllerTest.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/cart/presentation/ExceptionStatusMapperTest.java b/src/test/java/cart/presentation/ExceptionStatusMapperTest.java index 466fd0d60..737859f22 100644 --- a/src/test/java/cart/presentation/ExceptionStatusMapperTest.java +++ b/src/test/java/cart/presentation/ExceptionStatusMapperTest.java @@ -1,6 +1,7 @@ package cart.presentation; import cart.exception.application.IllegalMemberException; +import cart.exception.presentation.NoProperStatusCodeException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.DisplayNameGenerator; @@ -32,6 +33,6 @@ void exceptionStatusMapping_exception() { Exception exception = new Exception(); // when, then assertThatThrownBy(() -> ExceptionStatusMapper.of(exception)) - .isInstanceOf(IllegalStateException.class); + .isInstanceOf(NoProperStatusCodeException.class); } } diff --git a/src/test/java/cart/presentation/controller/CartItemControllerTest.java b/src/test/java/cart/presentation/controller/CartItemControllerTest.java index 3429da86e..c623b6ddb 100644 --- a/src/test/java/cart/presentation/controller/CartItemControllerTest.java +++ b/src/test/java/cart/presentation/controller/CartItemControllerTest.java @@ -96,7 +96,7 @@ void addCartItems() throws Exception { @DisplayName("장바구니 품목 수량을 변경할 수 있다") void updateCartItemQuantity() throws Exception { // given - CartItemQuantityRequest request = new CartItemQuantityRequest(); + CartItemQuantityRequest request = new CartItemQuantityRequest(3L); String body = objectMapper.writeValueAsString(request); doNothing().when(cartItemService).updateQuantity(any(), any(), any()); // when diff --git a/src/test/java/cart/presentation/controller/ProductControllerTest.java b/src/test/java/cart/presentation/controller/ProductControllerTest.java index 652ca70d0..e9cdca930 100644 --- a/src/test/java/cart/presentation/controller/ProductControllerTest.java +++ b/src/test/java/cart/presentation/controller/ProductControllerTest.java @@ -82,7 +82,7 @@ void getProductById() throws Exception { @DisplayName("상품을 생성할 수 있다") void createProduct() throws Exception { // given - ProductRequest request = new ProductRequest("피자", 1000L, "", 5.0, false); + ProductRequest request = new ProductRequest("피자", 1000L, "https://", 5.0, false); String body = objectMapper.writeValueAsString(request); when(productService.createProduct(any())).thenReturn(1L); // when @@ -99,7 +99,7 @@ void createProduct() throws Exception { @DisplayName("상품을 업데이트 할 수 있다") void updateProduct() throws Exception { // given - ProductRequest request = new ProductRequest("피자", 1000L, "", 5.0, false); + ProductRequest request = new ProductRequest("피자", 1000L, "https://", 5.0, false); String body = objectMapper.writeValueAsString(request); doNothing().when(productService).updateProduct(any(), any()); // when