diff --git a/src/test/java/com/gdschongik/gdsc/domain/study/application/StudyMentorServiceTest.java b/src/test/java/com/gdschongik/gdsc/domain/study/application/StudyMentorServiceTest.java index 1cc5581e3..c4ecb95ff 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/study/application/StudyMentorServiceTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/study/application/StudyMentorServiceTest.java @@ -2,8 +2,11 @@ import static org.assertj.core.api.Assertions.*; +import com.gdschongik.gdsc.domain.member.domain.Member; import com.gdschongik.gdsc.domain.member.domain.MemberRole; +import com.gdschongik.gdsc.domain.recruitment.domain.vo.Period; import com.gdschongik.gdsc.domain.study.dao.StudyDetailRepository; +import com.gdschongik.gdsc.domain.study.domain.Study; import com.gdschongik.gdsc.domain.study.domain.StudyDetail; import com.gdschongik.gdsc.domain.study.domain.StudyStatus; import com.gdschongik.gdsc.helper.IntegrationTest; @@ -27,7 +30,12 @@ class 스터디_과제_휴강_처리시 { void 성공한다() { // given LocalDateTime now = LocalDateTime.now(); - StudyDetail studyDetail = createStudyDetail(now, now.plusDays(7)); + Member mentor = createAssociateMember(); + Study study = createStudy( + mentor, + Period.createPeriod(now.plusDays(5), now.plusDays(10)), + Period.createPeriod(now.minusDays(5), now)); + StudyDetail studyDetail = createStudyDetail(study, now, now.plusDays(7)); logoutAndReloginAs(studyDetail.getStudy().getMentor().getId(), MemberRole.ASSOCIATE); // when diff --git a/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java b/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java index 4053200d5..ee4635223 100644 --- a/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java +++ b/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java @@ -188,14 +188,7 @@ protected Study createStudy(Member mentor, Period period, Period applicationPeri return studyRepository.save(study); } - protected StudyDetail createStudyDetail(LocalDateTime startDate, LocalDateTime endDate) { - Member mentor = createAssociateMember(); - LocalDateTime now = LocalDateTime.now(); - Study study = createStudy( - mentor, - Period.createPeriod(now.plusDays(5), now.plusDays(10)), - Period.createPeriod(now.minusDays(5), now)); - + protected StudyDetail createStudyDetail(Study study, LocalDateTime startDate, LocalDateTime endDate) { StudyDetail studyDetail = StudyDetail.createStudyDetail(study, 1L, ATTENDANCE_NUMBER, Period.createPeriod(startDate, endDate)); return studyDetailRepository.save(studyDetail);