-
Notifications
You must be signed in to change notification settings - Fork 0
test: Reply Domain 생성 , 상태 수정 , 내용 수정 코드 추가 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…Code REPLYCONTENTREQUIRED 추가
| private PostEntity parentPost; | ||
|
|
||
| public void update(String content) { | ||
| if ( Strings.isBlank(content) ) throw new CustomException(ErrorCode.REPLY_CONTENT_EMPTY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringUtils.hasText() 로 비교하는건 어떨까요 혹은 null 체크도 먼저 같이 하심이 좋을듯 합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringUtils.hasText() 로 비교하는건 어떨까요 혹은 null 체크도 먼저 같이 하심이 좋을듯 합니다
제 기억상으로 아마 org.apache.logging.log4j.util.Strings; Strings.isBlank() 랑 Strings.isNotBlank()가 null체크도 같이 포함되어있는걸로 알고있습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 이부분 Strings.isBlank로 체크하는데, null 까지 같이 체크해줍니다
| postEntity = new PostEntity(); | ||
| userEntity = new UserEntity(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빈값으로 생성을 함부로 하지 말라는 정책대로라고 한다면 여기서 new entity() 빈값으로 처리하시지 마시고
필드값 다 넣어서 만들어 버리세요!!
post랑 user 를 빈값으로 둬서 빈 게시판인지 없는 유저인지 등을 체크하시려고 하신것같은데, 그건 음 이미 상위 개념이니 PostTest, UserTest 에서 테스트를 마쳤다고 생각하시면 편할듯 합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빈값으로 생성을 함부로 하지 말라는 정책대로라고 한다면 여기서 new entity() 빈값으로 처리하시지 마시고 필드값 다 넣어서 만들어 버리세요!!
post랑 user 를 빈값으로 둬서 빈 게시판인지 없는 유저인지 등을 체크하시려고 하신것같은데, 그건 음 이미 상위 개념이니 PostTest, UserTest 에서 테스트를 마쳤다고 생각하시면 편할듯 합니다
넵 초기값 지정해서 처리하겠습니당
저도 도메인 팩토리 메서드 및 업데이트 메서드에 validation을 작성했습니다.
Errocode 임의로 REPLY_CONTENT_REQUIRED 생성해서 추가했습니다