From 7ebb435e21a03f5245f09a376f93cffb44a27209 Mon Sep 17 00:00:00 2001 From: subin Date: Tue, 20 Aug 2024 00:54:10 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EC=A3=BC=EB=AC=B8=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=20=EB=8B=A8=EC=9C=84=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/service/OrderUserServiceTest.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/kotlin/org/store/clothstar/order/service/OrderUserServiceTest.kt b/src/test/kotlin/org/store/clothstar/order/service/OrderUserServiceTest.kt index 887ad5d..70535b0 100644 --- a/src/test/kotlin/org/store/clothstar/order/service/OrderUserServiceTest.kt +++ b/src/test/kotlin/org/store/clothstar/order/service/OrderUserServiceTest.kt @@ -1,5 +1,6 @@ package org.store.clothstar.order.service +import io.kotest.matchers.ints.exactly import io.mockk.every import io.mockk.impl.annotations.InjectMockKs import io.mockk.impl.annotations.MockK @@ -30,6 +31,9 @@ import org.store.clothstar.order.domain.Order import org.store.clothstar.order.domain.OrderDetail import org.store.clothstar.order.domain.vo.* import org.store.clothstar.order.dto.request.AddOrderDetailRequest +import org.store.clothstar.order.dto.request.CreateOrderDetailRequest +import org.store.clothstar.order.dto.request.CreateOrderRequest +import org.store.clothstar.order.dto.request.OrderRequestWrapper import org.store.clothstar.order.dto.response.OrderResponse import org.store.clothstar.order.repository.OrderDetailRepository import org.store.clothstar.order.repository.OrderRepository @@ -346,6 +350,20 @@ class OrderUserServiceTest { verify(exactly = 1) { itemService.findByIdIn(listOf(itemId)) } } + @Test + @DisplayName("주문 저장") + fun saveOrder() { + //given + val orderRequestWrapper = mockk() + every { orderUserService.saveOrder(orderRequestWrapper) } returns orderId + + //when + orderUserService.saveOrder(orderRequestWrapper) + + //then + verify(exactly = 1) { orderSaveFacade.saveOrder(orderRequestWrapper) } + } + @Test @DisplayName("주문 상세 추가 - 성공 테스트") fun addOrderDetail_success_test() {