Skip to content

Modified2#4

Open
horobito wants to merge 153 commits intomainfrom
modified2
Open

Modified2#4
horobito wants to merge 153 commits intomainfrom
modified2

Conversation

@horobito
Copy link
Contributor

  • 타임라인 부터 pr 작성 시작

horobito added 29 commits April 20, 2021 18:40
 - 해당 feed 없을 경우 테스트
 - Feed 없을 경우

  + CommentHelper 생성
1. comment 를 추가할 feed 가 없을 경우
2. feed 는 있지만, 내용이 없는 경우
3. 작성자와 친구관계가 아예 없는 경우
4. 작성자와 친구가 승인되지 않은 경우
5. 댓글 생성 테스트
Copy link
Member

@aerain aerain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 코드 만족스럽네요


try {
CommentDto result = commentService.makeCommentByFeedIdAndContents(feedId, contents);
ResponseEntity.ok().body(result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 반환 안하는거같네요 🤔

Comment on lines +29 to +36
public Long getId(){
return this.id.getWriterId();
}

public String getName(){
return this.wrtName.getWriterName();
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 없는 편이 좋을것 같네요

WriterName wrtName = WriterName.create(user.getUserBasicInfo().getUsername());
Writer writer = Writer.create(id, wrtName);
if (friendship==null || friendship.getFriendState()!= FriendShipState.ACCEPT){
throw new IllegalAccessException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적절한 예외가 아닌것 같습니다?

if (myId.getId().equals(feed.getId())){
feed.delete();
}else {
throw new IllegalAccessException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요것도 마찬가집니다.

FriendShipResult result = friendShipService.deleteFriendShipRequest(friendId);
switch ((FriendShipResult)result){
case NEVER_REQUESTED:
ResponseEntity.status(HttpStatus.BAD_REQUEST);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반환이 필요없으면 작성하지 않아도 될 것 같습니다.

Comment on lines +59 to +60


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..? 요건 검증이 없네요

Comment on lines +169 to +173
//then

sut.create(1L);
System.out.println("forwardFriendShip의 상태 : " + forwardFriendShip.getFriendState());
System.out.println("backwardFriendShip의 상태 : " + backwardFriendShip.getFriendState());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요기도 검증이 없는것 같습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants