Skip to content

Commit 20bc66f

Browse files
committed
test(community): CommunityComment 작성자 확인 메서드 및 권한 예외 메세지 추가
1 parent 9f3333b commit 20bc66f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/com/somemore/community/domain/CommunityComment.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@ public CommunityComment(UUID writerId, String content, Long parentCommentId) {
3838
this.content = content;
3939
this.parentCommentId = parentCommentId;
4040
}
41+
42+
public boolean isWriter(UUID writerId) {
43+
return this.writerId.equals(writerId);
44+
}
4145
}

src/main/java/com/somemore/global/exception/ExceptionMessage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public enum ExceptionMessage {
1212
NOT_EXISTS_COMMUNITY_BOARD("존재하지 않는 게시글 입니다."),
1313
UNAUTHORIZED_COMMUNITY_BOARD("해당 게시글에 권한이 없습니다."),
1414
NOT_EXISTS_COMMUNITY_COMMENT("존재하지 않는 댓글 입니다."),
15+
UNAUTHORIZED_COMMUNITY_COMMENT("해당 댓글에 권한이 없습니다."),
1516
NOT_EXISTS_LOCATION("존재하지 않는 위치 ID 입니다."),
1617
NOT_EXISTS_RECRUIT_BOARD("존재하지 않는 봉사 모집글 ID 입니다."),
1718
UNAUTHORIZED_RECRUIT_BOARD("자신이 작성한 봉사 모집글이 아닙니다."),

0 commit comments

Comments
 (0)