From 990d15cbc9674f04b9a0d759778e66d1c2f1fff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=9C=EC=9D=B4=EB=AF=B8?= <63184334+JJ503@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:20:35 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=83=88=ED=87=B4=20=EC=8B=9C=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 요청 메서드 타입 변경 * test: 테스트 실패 해결 --- .../presentation/AuthenticationController.java | 3 +-- .../presentation/AuthenticationControllerTest.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/ddang/src/main/java/com/ddang/ddang/authentication/presentation/AuthenticationController.java b/backend/ddang/src/main/java/com/ddang/ddang/authentication/presentation/AuthenticationController.java index 8f8c1b6bd..dbe06a80a 100644 --- a/backend/ddang/src/main/java/com/ddang/ddang/authentication/presentation/AuthenticationController.java +++ b/backend/ddang/src/main/java/com/ddang/ddang/authentication/presentation/AuthenticationController.java @@ -14,7 +14,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -68,7 +67,7 @@ public ResponseEntity logout( .build(); } - @DeleteMapping("/withdrawal/{oauth2Type}") + @PostMapping("/withdrawal/{oauth2Type}") public ResponseEntity withdrawal( @PathVariable final Oauth2Type oauth2Type, @RequestHeader(HttpHeaders.AUTHORIZATION) final String accessToken, diff --git a/backend/ddang/src/test/java/com/ddang/ddang/authentication/presentation/AuthenticationControllerTest.java b/backend/ddang/src/test/java/com/ddang/ddang/authentication/presentation/AuthenticationControllerTest.java index ffd196c46..5f300a161 100644 --- a/backend/ddang/src/test/java/com/ddang/ddang/authentication/presentation/AuthenticationControllerTest.java +++ b/backend/ddang/src/test/java/com/ddang/ddang/authentication/presentation/AuthenticationControllerTest.java @@ -203,7 +203,6 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { ) ) ); - ; } @Test @@ -304,7 +303,7 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { willDoNothing().given(authenticationService).withdrawal(any(), anyString(), anyString()); // when & then - mockMvc.perform(RestDocumentationRequestBuilders.delete("/oauth2/withdrawal/{oauth2Type}", "kakao") + mockMvc.perform(RestDocumentationRequestBuilders.post("/oauth2/withdrawal/{oauth2Type}", "kakao") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(request)) .header(HttpHeaders.AUTHORIZATION, "Bearer accessToken") @@ -336,7 +335,7 @@ void setUp(@Autowired RestDocumentationContextProvider provider) { .withdrawal(any(), anyString(), anyString()); // when & then - mockMvc.perform(RestDocumentationRequestBuilders.delete("/oauth2/withdrawal/{oauth2Type}", "kakao") + mockMvc.perform(RestDocumentationRequestBuilders.post("/oauth2/withdrawal/{oauth2Type}", "kakao") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(request)) .header(HttpHeaders.AUTHORIZATION, "Bearer accessToken")