Skip to content
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: 리쿠르팅 테스트 상수 이름 수정 #505

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class 준회원으로_일괄_강등시 {
void 해당_학기에_이미_시작된_모집기간이_있다면_실패한다() {
// given
createRecruitmentRound(
RECRUITMENT_NAME, START_DATE, END_DATE, ACADEMIC_YEAR, SEMESTER_TYPE, ROUND_TYPE, FEE);
RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, ACADEMIC_YEAR, SEMESTER_TYPE, ROUND_TYPE, FEE);
MemberDemoteRequest request = new MemberDemoteRequest(ACADEMIC_YEAR, SEMESTER_TYPE);

// when & then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class 멤버십_가입신청시 {
FEE_NAME,
Period.createPeriod(SEMESTER_START_DATE, SEMESTER_END_DATE));
RecruitmentRound recruitmentRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);

// when
Membership membership = Membership.createMembership(member, recruitmentRound);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private RecruitmentRound createRecruitmentRound(
LocalDateTime endDate) {
Recruitment recruitment = Recruitment.createRecruitment(
academicYear, semesterType, fee, FEE_NAME, Period.createPeriod(SEMESTER_START_DATE, SEMESTER_END_DATE));
return RecruitmentRound.create(RECRUITMENT_NAME, startDate, endDate, recruitment, ROUND_TYPE);
return RecruitmentRound.create(RECRUITMENT_ROUND_NAME, startDate, endDate, recruitment, ROUND_TYPE);
}

@Nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class 임시주문_생성할때 {
Member member = createMember();
logoutAndReloginAs(1L, MemberRole.ASSOCIATE);
RecruitmentRound recruitmentRound = createRecruitmentRound(
RECRUITMENT_NAME,
RECRUITMENT_ROUND_NAME,
LocalDateTime.now().minusDays(1),
LocalDateTime.now().plusDays(1),
ACADEMIC_YEAR,
Expand Down Expand Up @@ -81,7 +81,7 @@ class 주문_완료할때 {
Member member = createMember();
logoutAndReloginAs(1L, MemberRole.ASSOCIATE);
RecruitmentRound recruitmentRound = createRecruitmentRound(
RECRUITMENT_NAME,
RECRUITMENT_ROUND_NAME,
LocalDateTime.now().minusDays(1),
LocalDateTime.now().plusDays(1),
ACADEMIC_YEAR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private RecruitmentRound createRecruitmentRound(
Recruitment recruitment = Recruitment.createRecruitment(
academicYear, semesterType, fee, FEE_NAME, Period.createPeriod(SEMESTER_START_DATE, SEMESTER_END_DATE));

return RecruitmentRound.create(RECRUITMENT_NAME, startDate, endDate, recruitment, RoundType.FIRST);
return RecruitmentRound.create(RECRUITMENT_ROUND_NAME, startDate, endDate, recruitment, RoundType.FIRST);
}

private Membership createMembership(Member member, RecruitmentRound recruitmentRound) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class 모집회차_생성시 {
void 학년도와_학기가_일치하는_리쿠르팅이_존재하지_않는다면_실패한다() {
// given
RecruitmentRoundCreateUpdateRequest request = new RecruitmentRoundCreateUpdateRequest(
ACADEMIC_YEAR, SEMESTER_TYPE, RECRUITMENT_NAME, START_DATE, END_DATE, ROUND_TYPE);
ACADEMIC_YEAR, SEMESTER_TYPE, RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, ROUND_TYPE);

// when & then
assertThatThrownBy(() -> adminRecruitmentService.createRecruitmentRound(request))
Expand All @@ -74,7 +74,7 @@ class 모집회차_수정시 {
recruitmentRepository.save(recruitment);

RecruitmentRound recruitmentRound = RecruitmentRound.create(
RECRUITMENT_NAME, now.plusDays(1), now.plusDays(2), recruitment, ROUND_TYPE);
RECRUITMENT_ROUND_NAME, now.plusDays(1), now.plusDays(2), recruitment, ROUND_TYPE);
recruitmentRoundRepository.save(recruitmentRound);

RecruitmentRoundCreateUpdateRequest request = new RecruitmentRoundCreateUpdateRequest(
Expand All @@ -96,7 +96,7 @@ class 모집회차_수정시 {
void 모집회차가_존재하지_않는다면_실패한다() {
// given
RecruitmentRoundCreateUpdateRequest request = new RecruitmentRoundCreateUpdateRequest(
ACADEMIC_YEAR, SEMESTER_TYPE, RECRUITMENT_NAME, START_DATE, END_DATE, ROUND_TYPE);
ACADEMIC_YEAR, SEMESTER_TYPE, RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, ROUND_TYPE);

// when & then
assertThatThrownBy(() -> adminRecruitmentService.updateRecruitmentRound(1L, request))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class 모집회차_생성시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound recruitmentRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);

// when & then
assertThatThrownBy(() -> recruitmentRoundValidator.validateRecruitmentRoundCreate(
Expand Down Expand Up @@ -107,7 +107,7 @@ class 모집회차_생성시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound recruitmentRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);

// when & then
assertThatThrownBy(() -> recruitmentRoundValidator.validateRecruitmentRoundCreate(
Expand All @@ -127,11 +127,11 @@ class 모집회차_수정시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound firstRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
ReflectionTestUtils.setField(firstRound, "id", 1L);

RecruitmentRound secondRound = RecruitmentRound.create(
RECRUITMENT_NAME, ROUND_TWO_START_DATE, ROUND_TWO_END_DATE, recruitment, RoundType.SECOND);
RECRUITMENT_ROUND_NAME, ROUND_TWO_START_DATE, ROUND_TWO_END_DATE, recruitment, RoundType.SECOND);
ReflectionTestUtils.setField(secondRound, "id", 2L);

// when & then
Expand All @@ -148,11 +148,11 @@ class 모집회차_수정시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound firstRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
ReflectionTestUtils.setField(firstRound, "id", 1L);

RecruitmentRound secondRound = RecruitmentRound.create(
RECRUITMENT_NAME, ROUND_TWO_START_DATE, ROUND_TWO_END_DATE, recruitment, RoundType.SECOND);
RECRUITMENT_ROUND_NAME, ROUND_TWO_START_DATE, ROUND_TWO_END_DATE, recruitment, RoundType.SECOND);
ReflectionTestUtils.setField(secondRound, "id", 2L);

// when & then
Expand All @@ -169,7 +169,7 @@ class 모집회차_수정시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound firstRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
ReflectionTestUtils.setField(firstRound, "id", 1L);

// when & then
Expand All @@ -186,7 +186,7 @@ class 모집회차_수정시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound firstRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
ReflectionTestUtils.setField(firstRound, "id", 1L);

// when & then
Expand All @@ -203,7 +203,7 @@ class 모집회차_수정시 {
ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.createPeriod(START_DATE, END_DATE));

RecruitmentRound recruitmentRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
long recruitmentRoundId = 1L;
ReflectionTestUtils.setField(recruitmentRound, "id", recruitmentRoundId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class RecruitmentConstant {
// 1차 모집 상수
public static final String RECRUITMENT_NAME = "2024학년도 1학기 1차 모집";
public static final String RECRUITMENT_ROUND_NAME = "2024학년도 1학기 1차 모집";
public static final LocalDateTime START_DATE = LocalDateTime.of(2024, 3, 2, 0, 0);
public static final LocalDateTime BETWEEN_START_AND_END_DATE = LocalDateTime.of(2024, 3, 3, 0, 0);
public static final LocalDateTime WRONG_END_DATE = LocalDateTime.of(2024, 3, 2, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected RecruitmentRound createRecruitmentRound() {
Recruitment recruitment = createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE);

RecruitmentRound recruitmentRound =
RecruitmentRound.create(RECRUITMENT_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);
RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_DATE, END_DATE, recruitment, ROUND_TYPE);

return recruitmentRoundRepository.save(recruitmentRound);
}
Expand Down