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