-
Notifications
You must be signed in to change notification settings - Fork 1
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
test: 1차 모집시 멤버십 생성 후 실제 가입하지 않은 경우 2차 모집 멤버십 접수 테스트 추가 #744
Conversation
Walkthrough변경 사항은 Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/test/java/com/gdschongik/gdsc/domain/membership/application/MembershipServiceTest.java (2 hunks)
Additional comments not posted (1)
src/test/java/com/gdschongik/gdsc/domain/membership/application/MembershipServiceTest.java (1)
5-5
: 새로운 임포트 추가 승인새로운 테스트 메서드에 필요한 클래스들을 적절히 임포트하였습니다.
Also applies to: 9-9, 14-14, 17-17
@Test | ||
void 멤버십을_1차모집시_생성했지만_정회원_가입조건을_만족하지_않았다면_2차모집에서_멤버십_가입신청에_성공한다() { | ||
// given | ||
createMember(); | ||
logoutAndReloginAs(1L, ASSOCIATE); | ||
|
||
RecruitmentRound firstRound = createRecruitmentRound( | ||
RECRUITMENT_ROUND_NAME, | ||
LocalDateTime.now().minusDays(5), | ||
LocalDateTime.now().plusDays(1), | ||
ACADEMIC_YEAR, | ||
SEMESTER_TYPE, | ||
ROUND_TYPE, | ||
Money.from(20000L)); | ||
|
||
RecruitmentRound secondRound = createRecruitmentRound( | ||
RECRUITMENT_ROUND_NAME, | ||
LocalDateTime.now().minusDays(1), | ||
LocalDateTime.now().plusDays(1), | ||
ACADEMIC_YEAR, | ||
SEMESTER_TYPE, | ||
RoundType.SECOND, | ||
Money.from(20000L)); | ||
|
||
// when & then | ||
membershipService.submitMembership(firstRound.getId()); | ||
|
||
assertThatCode(() -> membershipService.submitMembership(secondRound.getId())) | ||
.doesNotThrowAnyException(); | ||
} |
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.
테스트 메서드 개선 제안
새로운 테스트 메서드가 시나리오를 잘 커버하고 있습니다. 다음과 같은 개선 사항을 제안합니다:
- 첫 번째 라운드 제출에 대한 검증을 추가하세요.
첫 번째 라운드 제출 후 예외가 발생하지 않는지 확인하는 assertion을 추가하세요. 예:
assertThatCode(() -> membershipService.submitMembership(firstRound.getId()))
.doesNotThrowAnyException();
- 각 제출 후 멤버십 상태를 확인하세요.
각 라운드 제출 후 멤버십 상태를 확인하는 assertion을 추가하세요. 예:
Membership firstRoundMembership = membershipRepository.findByMemberIdAndRecruitmentRoundId(1L, firstRound.getId()).orElseThrow();
assertThat(firstRoundMembership.getStatus()).isEqualTo(MembershipStatus.PENDING);
Membership secondRoundMembership = membershipRepository.findByMemberIdAndRecruitmentRoundId(1L, secondRound.getId()).orElseThrow();
assertThat(secondRoundMembership.getStatus()).isEqualTo(MembershipStatus.PENDING);
- 테스트 시나리오에 대한 영문 설명을 추가하세요.
메서드 이름 위에 영문으로 테스트 시나리오를 설명하는 주석을 추가하세요. 예:
/**
* Test case: Successful membership application in the second recruitment round
* Scenario: A member created a membership in the first round but did not meet the full membership conditions.
* Expected: The member should be able to successfully apply for membership in the second round.
*/
이러한 개선사항들은 테스트의 가독성과 유지보수성을 향상시킬 것입니다.
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.
lgtm
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.
LGTM
🌱 관련 이슈
📌 작업 내용 및 특이사항
📝 참고사항
📚 기타
Summary by CodeRabbit