Skip to content

Commit

Permalink
refactor: STUDY_ONGOING_PERIOD 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
uwoobeat committed Oct 1, 2024
1 parent 875319e commit b676d6b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ private AssignmentHistory createAssignmentHistory() {
}

private Study createStudyWithMentor(Long mentorId) {
Period period = Period.createPeriod(STUDY_START_DATETIME, STUDY_END_DATETIME);
Period applicationPeriod =
Period.createPeriod(STUDY_START_DATETIME.minusDays(7), STUDY_START_DATETIME.minusDays(1));
return fixtureHelper.createStudyWithMentor(mentorId, period, applicationPeriod);
return fixtureHelper.createStudyWithMentor(mentorId, STUDY_ONGOING_PERIOD, applicationPeriod);
}

@Nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ private Member createMember(Long id) {
}

private Study createStudyWithMentor(Long mentorId) {
Period period = Period.createPeriod(STUDY_START_DATETIME, STUDY_END_DATETIME);
Period applicationPeriod =
Period.createPeriod(STUDY_START_DATETIME.minusDays(7), STUDY_START_DATETIME.minusDays(1));
return fixtureHelper.createStudyWithMentor(mentorId, period, applicationPeriod);
return fixtureHelper.createStudyWithMentor(mentorId, STUDY_ONGOING_PERIOD, applicationPeriod);
}

private StudyDetail createStudyDetailWithAssignment(Study study) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ private Member createMember(Long id) {
}

private Study createStudyWithMentor(Long mentorId) {
Period period = Period.createPeriod(STUDY_START_DATETIME, STUDY_END_DATETIME);
Period applicationPeriod =
Period.createPeriod(STUDY_START_DATETIME.minusDays(7), STUDY_START_DATETIME.minusDays(1));
return fixtureHelper.createStudyWithMentor(mentorId, period, applicationPeriod);
return fixtureHelper.createStudyWithMentor(mentorId, STUDY_ONGOING_PERIOD, applicationPeriod);
}

private StudyDetail createStudyDetailWithAssignment(Study study) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class 스터디_개설시 {
void 게스트인_회원을_멘토로_지정하면_실패한다() {
// given
Member guestMember = Member.createGuestMember(OAUTH_ID);
Period period = Period.createPeriod(START_DATE, END_DATE);
Period applicationPeriod = Period.createPeriod(START_DATE.minusDays(10), START_DATE.minusDays(5));

// when & then
Expand All @@ -46,7 +45,7 @@ class 스터디_개설시 {
SEMESTER_TYPE,
STUDY_TITLE,
guestMember,
period,
START_TO_END_PERIOD,
applicationPeriod,
TOTAL_WEEK,
ONLINE_STUDY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gdschongik.gdsc.global.common.constant;

import com.gdschongik.gdsc.domain.recruitment.domain.vo.Period;
import com.gdschongik.gdsc.domain.study.domain.StudyType;
import java.time.DayOfWeek;
import java.time.LocalDateTime;
Expand All @@ -26,6 +27,7 @@ private StudyConstant() {}
// Study (2024-09-01 ~ 2024-10-27)
public static final LocalDateTime STUDY_START_DATETIME = LocalDateTime.of(2024, 9, 1, 0, 0);
public static final LocalDateTime STUDY_END_DATETIME = STUDY_START_DATETIME.plusWeeks(8);
public static final Period STUDY_ONGOING_PERIOD = Period.createPeriod(STUDY_START_DATETIME, STUDY_END_DATETIME);
public static final String STUDY_NOTION_LINK = "notionLink";
public static final String STUDY_INTRODUCTION = "introduction";

Expand Down

0 comments on commit b676d6b

Please sign in to comment.