From b676d6be8edb7e821b08d5621150cb1257b33df4 Mon Sep 17 00:00:00 2001 From: Jaehyun Ahn Date: Tue, 1 Oct 2024 23:07:28 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20STUDY=5FONGOING=5FPERIOD=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gdsc/domain/study/domain/AssignmentHistoryGraderTest.java | 3 +-- .../gdsc/domain/study/domain/AssignmentHistoryTest.java | 3 +-- .../study/domain/StudyAssignmentHistoryValidatorTest.java | 3 +-- .../com/gdschongik/gdsc/domain/study/domain/StudyTest.java | 3 +-- .../gdschongik/gdsc/global/common/constant/StudyConstant.java | 2 ++ 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryGraderTest.java b/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryGraderTest.java index 671488c27..2f004cc66 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryGraderTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryGraderTest.java @@ -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 diff --git a/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryTest.java b/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryTest.java index 3c45e14d1..689852f10 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistoryTest.java @@ -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) { diff --git a/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyAssignmentHistoryValidatorTest.java b/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyAssignmentHistoryValidatorTest.java index 5af2b9699..c2fae7e91 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyAssignmentHistoryValidatorTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyAssignmentHistoryValidatorTest.java @@ -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) { diff --git a/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyTest.java b/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyTest.java index d98bccf2d..0d04fa356 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/study/domain/StudyTest.java @@ -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 @@ -46,7 +45,7 @@ class 스터디_개설시 { SEMESTER_TYPE, STUDY_TITLE, guestMember, - period, + START_TO_END_PERIOD, applicationPeriod, TOTAL_WEEK, ONLINE_STUDY, diff --git a/src/test/java/com/gdschongik/gdsc/global/common/constant/StudyConstant.java b/src/test/java/com/gdschongik/gdsc/global/common/constant/StudyConstant.java index d39cf6334..bdc0afaea 100644 --- a/src/test/java/com/gdschongik/gdsc/global/common/constant/StudyConstant.java +++ b/src/test/java/com/gdschongik/gdsc/global/common/constant/StudyConstant.java @@ -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; @@ -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";