-
Notifications
You must be signed in to change notification settings - Fork 2
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
[TLVB-225] 리뷰, 좋아요 레퍼지토리, 서비스, 컨트롤러 테스트 코드 작성 #78
base: develop
Are you sure you want to change the base?
Conversation
|
@WithSecurityContext(factory = WithMockAuthUserSecurityContextFactory.class) | ||
public @interface WithMockAuthUser { | ||
|
||
long id() default 1L; |
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.
Long 으로 하는게 더 좋아보이네요 :)
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.
앗 그러네요! 감사함니당 👍👍
event.getId()); | ||
|
||
// then | ||
assertThat(searchedEventLike).isPresent(); |
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.
아래서 검증하니깐 이건 괜찮지 않을까요?
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.
그러네여..ㅠ 삭제해도 괜찮을 것 같숨다
assertThat(savedReview.getDescription()).isEqualTo(review.getDescription()); | ||
assertThat(savedReview.getPictureUrl()).isEqualTo(review.getPictureUrl()); |
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.
assertAll()을 한번 써보면 좋을거 같네요 :)
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.
넵!
|
||
@BeforeEach | ||
void setUp() { | ||
user = User.builder() |
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.
프로젝트가 거대해지면서 테스트에 대해서 중복코드가 굉장히 많아 지죠 :)
TestFixture라는걸 한번 적용해보면 어떠신가요?
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.
오 한번 적용해보겠습니다!! Fixture 클래스에 static 변수로 객체 생성해놓고 사용하면 코드가 많이 깔끔해지겠네용 😸
👩💻 요구 사항과 구현 내용
✅ 피드백 반영사항
🤔 PR 포인트 & 궁금한 점
관련 이슈
TLVB-225