From 59674bc7aa334be0f38b18710b7ffb121535df86 Mon Sep 17 00:00:00 2001 From: seungsje Date: Sat, 23 Mar 2024 17:57:32 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=A3=BC=EC=84=9D=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20=EB=B0=8F=20=EC=8B=A4=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/admin/templates/service/TemplateAdminService.java | 8 ++++---- .../api/admin/template/TemplateAdminControllerTest.java | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gg-pingpong-api/src/main/java/gg/party/api/admin/templates/service/TemplateAdminService.java b/gg-pingpong-api/src/main/java/gg/party/api/admin/templates/service/TemplateAdminService.java index 4b68a3314..b34877770 100644 --- a/gg-pingpong-api/src/main/java/gg/party/api/admin/templates/service/TemplateAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/party/api/admin/templates/service/TemplateAdminService.java @@ -21,7 +21,7 @@ public class TemplateAdminService { /** * 템플릿 추가 - * @exception CategoryNotFoundException 존재하지 않는 카테고리 입력 + * @exception CategoryNotFoundException 존재하지 않는 카테고리 입력 - 404 */ public void addTemplate(TemplateAdminCreateReqDto request) { Category category = categoryRepository.findById(request.getCategoryId()) @@ -34,8 +34,8 @@ public void addTemplate(TemplateAdminCreateReqDto request) { /** * 템플릿 수정 - * @exception TemplateNotFoundException 존재하지 않는 템플릿 입력 - * @exception CategoryNotFoundException 존재하지 않는 카테고리 입력 + * @exception TemplateNotFoundException 존재하지 않는 템플릿 입력 - 404 + * @exception CategoryNotFoundException 존재하지 않는 카테고리 입력 - 404 */ @Transactional public void modifyTemplate(Long templateId, TemplateAdminUpdateReqDto request) { @@ -64,7 +64,7 @@ public void modifyTemplate(Long templateId, TemplateAdminUpdateReqDto request) { /** * 템플릿 삭제 - * @exception TemplateNotFoundException 존재하지 않는 템플릿 입력 + * @exception TemplateNotFoundException 존재하지 않는 템플릿 입력 - 404 */ @Transactional public void removeTemplate(Long templateId) { diff --git a/gg-pingpong-api/src/test/java/gg/party/api/admin/template/TemplateAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/party/api/admin/template/TemplateAdminControllerTest.java index b5c0a3f9a..160db0c8d 100644 --- a/gg-pingpong-api/src/test/java/gg/party/api/admin/template/TemplateAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/party/api/admin/template/TemplateAdminControllerTest.java @@ -229,7 +229,7 @@ public void success() throws Exception { } @Test - @DisplayName("템플릿 없음으로 인한 삭제 실패 204") + @DisplayName("템플릿 없음으로 인한 삭제 실패 404") public void fail() throws Exception { String templateId = "10"; String url = "/party/admin/templates/" + templateId; @@ -237,9 +237,7 @@ public void fail() throws Exception { mockMvc.perform(delete(url) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, "Bearer " + userAccessToken)) - .andExpect(status().isNoContent()); - //then - assertThat(templateRepository.findAll()).isEmpty(); + .andExpect(status().isNotFound()); } } }