Skip to content

Conversation

@discphy
Copy link
Owner

@discphy discphy commented Mar 19, 2025

📅 미션 일자

  • Day 18

✅ 미션 내용

  • @Mock, @MockBean, @Spy, @SpyBean, @InjectMocks의 차이
  • 테스트 코드 @BeforeEach절 및 BDD 절에 배치 하기

🔗 미션 링크

💭 리뷰 요구사항

  • @BeforeEach절에는 실제 댓글을 테스트 하기 위해 필요한 사용자 생성 로직과 게시물 생성 로직을 배치하였습니다.
  • "자신이 작성한 댓글이 아니면 수정할 수 없다." 테스트에서는 사용자2 생성 로직given 절에 배치했습니다. 또한, "수정할 수 없다"에 대한 테스트이기 때문에 when & then 절을 통합한 예외 검증이 이루어져야 하기 때문에 다음과 같이 배치하였습니다.

@discphy discphy self-assigned this Mar 19, 2025
Comment on lines +9 to +15
@BeforeEach
void setUp() {
1-1. 2-1. 3-1. 사용자 생성에 필요한 내용 준비
1-2. 2-2. 3-2. 사용자 생성
1-3. 2-3. 3-5. 게시물 생성에 필요한 내용 준비
1-4. 2-4. 3-6. 게시물 생성
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

댓글을 테스트 하기 위해 필요한 사용자 생성 로직과 게시물 생성 로직을 setup 절에 배치

@discphy discphy marked this pull request as ready for review March 25, 2025 00:09
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