Skip to content

Commit

Permalink
feat, test: 클럽 삭제 구현, 테스트 코드 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
choi5798 committed Oct 27, 2023
1 parent 6003487 commit d63d949
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public ResponseEntity<ClubGetResponse> getClub(@PathVariable Long clubId) {

@DeleteMapping("/clubs/{clubId}")
public ResponseEntity<String> deleteClub(@PathVariable Long clubId) {
return ResponseEntity.ok("delete club.");
service.deleteClub(clubId);
return ResponseEntity.noContent().build();
}

}
4 changes: 4 additions & 0 deletions src/main/java/com/spaceclub/club/service/ClubService.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ public Club getClub(Long clubId) {
.orElseThrow(() -> new IllegalArgumentException("해당하는 클럽이 없습니다"));
}

public void deleteClub(Long clubId) {
repository.deleteById(clubId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ClubControllerTest {
.contentType(MediaType.APPLICATION_JSON));

// then
result.andExpect(status().isOk())
result.andExpect(status().isNoContent())
.andDo(print())
.andDo(document("club/delete",
preprocessRequest(prettyPrint()),
Expand Down

0 comments on commit d63d949

Please sign in to comment.