Skip to content

Commit

Permalink
[fix] 주석 수정 및 실수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
AreSain committed Mar 23, 2024
1 parent 80dbbd8 commit 59674bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TemplateAdminService {

/**
* 템플릿 추가
* @exception CategoryNotFoundException 존재하지 않는 카테고리 입력
* @exception CategoryNotFoundException 존재하지 않는 카테고리 입력 - 404
*/
public void addTemplate(TemplateAdminCreateReqDto request) {
Category category = categoryRepository.findById(request.getCategoryId())
Expand All @@ -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) {
Expand Down Expand Up @@ -64,7 +64,7 @@ public void modifyTemplate(Long templateId, TemplateAdminUpdateReqDto request) {

/**
* 템플릿 삭제
* @exception TemplateNotFoundException 존재하지 않는 템플릿 입력
* @exception TemplateNotFoundException 존재하지 않는 템플릿 입력 - 404
*/
@Transactional
public void removeTemplate(Long templateId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,15 @@ public void success() throws Exception {
}

@Test
@DisplayName("템플릿 없음으로 인한 삭제 실패 204")
@DisplayName("템플릿 없음으로 인한 삭제 실패 404")
public void fail() throws Exception {
String templateId = "10";
String url = "/party/admin/templates/" + templateId;
//given && when
mockMvc.perform(delete(url)
.contentType(MediaType.APPLICATION_JSON)
.header(HttpHeaders.AUTHORIZATION, "Bearer " + userAccessToken))
.andExpect(status().isNoContent());
//then
assertThat(templateRepository.findAll()).isEmpty();
.andExpect(status().isNotFound());
}
}
}

0 comments on commit 59674bc

Please sign in to comment.