Skip to content

Commit

Permalink
refactor: 스터디상세 정적 팩토리 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
uwoobeat committed Oct 15, 2024
1 parent 3f0edc1 commit eee5c51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private StudyDetail(
this.assignment = assignment;
}

public static StudyDetail createStudyDetail(Study study, Long week, String attendanceNumber, Period period) {
public static StudyDetail create(Study study, Long week, String attendanceNumber, Period period) {
return StudyDetail.builder()
.study(study)
.week(week)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public StudyDetail createNoneStudyDetail(Study study, Long week) {

String attendanceNumber =
new Random().ints(4, 0, 10).mapToObj(String::valueOf).reduce("", String::concat);
return StudyDetail.createStudyDetail(study, week, attendanceNumber, Period.of(startDate, endDate));
return StudyDetail.create(study, week, attendanceNumber, Period.of(startDate, endDate));
}
}
5 changes: 2 additions & 3 deletions src/test/java/com/gdschongik/gdsc/helper/FixtureHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ public Study createStudyWithMentor(Long mentorId, Period period, Period applicat
}

public StudyDetail createStudyDetail(Study study, LocalDateTime startDate, LocalDateTime endDate) {
return StudyDetail.createStudyDetail(study, 1L, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
return StudyDetail.create(study, 1L, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
}

public StudyDetail createNewStudyDetail(
Long id, Study study, Long week, LocalDateTime startDate, LocalDateTime endDate) {
StudyDetail studyDetail =
StudyDetail.createStudyDetail(study, week, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
StudyDetail studyDetail = StudyDetail.create(study, week, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
ReflectionTestUtils.setField(studyDetail, "id", id);
return studyDetail;
}
Expand Down
6 changes: 2 additions & 4 deletions src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,12 @@ protected Study createNewStudy(Member mentor, Long totalWeek, Period period, Per
}

protected StudyDetail createStudyDetail(Study study, LocalDateTime startDate, LocalDateTime endDate) {
StudyDetail studyDetail =
StudyDetail.createStudyDetail(study, 1L, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
StudyDetail studyDetail = StudyDetail.create(study, 1L, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
return studyDetailRepository.save(studyDetail);
}

protected StudyDetail createNewStudyDetail(Long week, Study study, LocalDateTime startDate, LocalDateTime endDate) {
StudyDetail studyDetail =
StudyDetail.createStudyDetail(study, week, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
StudyDetail studyDetail = StudyDetail.create(study, week, ATTENDANCE_NUMBER, Period.of(startDate, endDate));
return studyDetailRepository.save(studyDetail);
}

Expand Down

0 comments on commit eee5c51

Please sign in to comment.