From 2923e8a327af2d4c509d6b90b6da3cf8227602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=AC=EC=9A=B0?= Date: Mon, 23 Dec 2024 09:03:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(voc):=20=EB=AC=B8=EC=9D=98=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EC=9D=91=EB=8B=B5=20=EC=83=81=ED=83=9C=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20200=20->=20201=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/codezap/voc/controller/VocController.java | 3 ++- .../test/java/codezap/voc/controller/VocControllerTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/codezap/voc/controller/VocController.java b/backend/src/main/java/codezap/voc/controller/VocController.java index 17b9b4a99..848d41251 100644 --- a/backend/src/main/java/codezap/voc/controller/VocController.java +++ b/backend/src/main/java/codezap/voc/controller/VocController.java @@ -2,6 +2,7 @@ import jakarta.validation.Valid; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -20,6 +21,6 @@ public class VocController implements SpringDocVocController { @PostMapping("/contact") public ResponseEntity create(@Valid @RequestBody VocRequest request) { vocService.create(request); - return ResponseEntity.ok().build(); + return ResponseEntity.status(HttpStatus.CREATED).build(); } } diff --git a/backend/src/test/java/codezap/voc/controller/VocControllerTest.java b/backend/src/test/java/codezap/voc/controller/VocControllerTest.java index 0cdaf89f3..cab18b2bb 100644 --- a/backend/src/test/java/codezap/voc/controller/VocControllerTest.java +++ b/backend/src/test/java/codezap/voc/controller/VocControllerTest.java @@ -22,7 +22,7 @@ void create() throws Exception { mvc.perform(post("/contact") .content(objectMapper.writeValueAsString(request)) .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isOk()); + .andExpect(status().isCreated()); } @Test