From 6155a5ef12a7fc512968fdc865d01fc676dde11e Mon Sep 17 00:00:00 2001 From: Hyeon-Uk Date: Wed, 28 Aug 2024 16:17:44 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EA=B8=B0=EC=A1=B4=20=EA=B0=99=EC=9D=80?= =?UTF-8?q?=20=EC=9D=91=EB=8B=B5=EC=9D=84=20=EA=B2=80=EC=A6=9D=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=9D=B4=EB=AF=B8=20=EC=99=84=EB=A3=8C=EB=90=9C=20?= =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EC=9D=B4=EB=9D=BC=EB=8A=94=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EC=9D=84=20=EA=B2=80=EC=A6=9D=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=BD=94=EB=93=9C=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dr-KoKo <97681286+dr-koko@users.noreply.github.com> --- .../api/order/OrderApiControllerAOPTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/java/camp/woowak/lab/web/api/order/OrderApiControllerAOPTest.java b/src/test/java/camp/woowak/lab/web/api/order/OrderApiControllerAOPTest.java index 72dfdcc9..b2375419 100644 --- a/src/test/java/camp/woowak/lab/web/api/order/OrderApiControllerAOPTest.java +++ b/src/test/java/camp/woowak/lab/web/api/order/OrderApiControllerAOPTest.java @@ -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; @@ -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