Skip to content

Commit

Permalink
[fix] 기존 같은 응답을 검증하는 테스트코드를 이미 완료된 주문이라는 응답을 검증하는 테스트코드로 수정
Browse files Browse the repository at this point in the history
Co-authored-by: Dr-KoKo <[email protected]>
  • Loading branch information
Hyeon-Uk and Dr-KoKo committed Aug 28, 2024
1 parent 075f2a3 commit 6155a5e
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;

import camp.woowak.lab.order.exception.OrderErrorCode;
import camp.woowak.lab.order.service.OrderCreationService;
import camp.woowak.lab.order.service.RetrieveOrderListService;
import camp.woowak.lab.order.service.command.OrderCreationCommand;
Expand Down Expand Up @@ -109,14 +110,14 @@ void idempotentSuccessWithBeforeResult() throws Exception {
verify(orderCreationService, times(1)).create(any(OrderCreationCommand.class));
action1.andExpect(status().isCreated())
.andExpect(jsonPath("$.data.orderId").value(1L));
action2.andExpect(status().isCreated())
.andExpect(jsonPath("$.data.orderId").value(1L));
action3.andExpect(status().isCreated())
.andExpect(jsonPath("$.data.orderId").value(1L));
action4.andExpect(status().isCreated())
.andExpect(jsonPath("$.data.orderId").value(1L));
action5.andExpect(status().isCreated())
.andExpect(jsonPath("$.data.orderId").value(1L));
action2.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.errorCode").value(OrderErrorCode.ALREADY_COMPLETED_ORDER.getErrorCode()));
action3.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.errorCode").value(OrderErrorCode.ALREADY_COMPLETED_ORDER.getErrorCode()));
action4.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.errorCode").value(OrderErrorCode.ALREADY_COMPLETED_ORDER.getErrorCode()));
action5.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.errorCode").value(OrderErrorCode.ALREADY_COMPLETED_ORDER.getErrorCode()));
}

@Test
Expand Down

0 comments on commit 6155a5e

Please sign in to comment.