Skip to content

Commit

Permalink
refactor: 페이징 조회, 주문 상세 추가 테스트 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
axhtl committed Sep 5, 2024
1 parent c41bd63 commit 0029dfe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class OrderUserServiceTest {
// given
val pageable: Pageable = PageRequest.of(0, 10)
val orders: Page<Order> = PageImpl(listOf(order))
every { orderRepository.findAll(pageable) } returns orders
every { orderRepository.findAllByOrderByOrderIdDesc(pageable) } returns orders

// order 관련 member, address, seller 불러오기
every { order.memberId } returns memberId
Expand Down Expand Up @@ -342,7 +342,7 @@ class OrderUserServiceTest {

// then
assertThat(orderResponses.content).usingRecursiveComparison().isEqualTo(listOf(expectedOrderResponse))
verify(exactly = 1) { orderRepository.findAll(pageable) }
verify(exactly = 1) { orderRepository.findAllByOrderByOrderIdDesc(pageable) }
verify(exactly = 1) { memberService.getMemberByMemberId(memberId) }
verify(exactly = 1) { addressService.getAddressById(addressId) }
verify(exactly = 1) { sellerService.getSellerById(memberId) }
Expand Down Expand Up @@ -395,6 +395,8 @@ class OrderUserServiceTest {
every { orderDetail.price.oneKindTotalPrice } returns 10000
every { order.totalPrice.shipping } returns 3000

justRun { order.addOrderDetail(any()) }

every { orderDetail.quantity } returns addOrderDetailRequest.quantity

justRun { order.totalPrice.updatePrices(any(), any()) }
Expand Down

0 comments on commit 0029dfe

Please sign in to comment.