From 1f23e78fa8e40494751e5306e624cc93e798d9d4 Mon Sep 17 00:00:00 2001 From: Jaehyun Ahn Date: Tue, 15 Oct 2024 20:21:17 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=97=94=ED=8B=B0=ED=8B=B0=20?= =?UTF-8?q?=EC=A0=95=EC=A0=81=20=ED=8C=A9=ED=86=A0=EB=A6=AC=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coupon/application/CouponService.java | 4 +- .../gdsc/domain/coupon/domain/Coupon.java | 2 +- .../domain/coupon/domain/IssuedCoupon.java | 2 +- .../member/application/TestMemberService.java | 2 +- .../gdsc/domain/member/domain/Member.java | 2 +- .../application/MembershipService.java | 2 +- .../domain/membership/domain/Membership.java | 2 +- .../application/AdminRecruitmentService.java | 2 +- .../recruitment/domain/Recruitment.java | 2 +- .../study/application/MentorStudyService.java | 3 +- .../gdsc/domain/study/domain/Study.java | 2 +- .../study/domain/StudyAnnouncement.java | 2 +- .../study/factory/StudyDomainFactory.java | 2 +- .../global/security/CustomUserService.java | 4 +- .../gdsc/domain/coupon/domain/CouponTest.java | 4 +- .../coupon/domain/IssuedCouponTest.java | 36 +++++++-------- .../application/AdminMemberServiceTest.java | 2 +- .../OnboardingMemberServiceTest.java | 2 +- .../member/dao/MemberRepositoryTest.java | 2 +- .../gdsc/domain/member/domain/MemberTest.java | 44 +++++++++---------- .../member/domain/MemberValidatorTest.java | 2 +- .../membership/domain/MembershipTest.java | 6 +-- .../domain/MembershipValidatorTest.java | 8 ++-- .../AdminRecruitmentServiceTest.java | 4 +- .../domain/RecruitmentRoundValidatorTest.java | 22 +++++----- .../recruitment/domain/RecruitmentTest.java | 2 +- .../gdsc/domain/study/domain/StudyTest.java | 16 +++---- .../gdschongik/gdsc/helper/FixtureHelper.java | 12 ++--- .../gdsc/helper/IntegrationTest.java | 16 +++---- 29 files changed, 104 insertions(+), 107 deletions(-) diff --git a/src/main/java/com/gdschongik/gdsc/domain/coupon/application/CouponService.java b/src/main/java/com/gdschongik/gdsc/domain/coupon/application/CouponService.java index b182589c1..9ad845d88 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/coupon/application/CouponService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/coupon/application/CouponService.java @@ -37,7 +37,7 @@ public class CouponService { @Transactional public void createCoupon(CouponCreateRequest request) { - Coupon coupon = Coupon.createCoupon(request.name(), Money.from(request.discountAmount())); + Coupon coupon = Coupon.create(request.name(), Money.from(request.discountAmount())); couponRepository.save(coupon); log.info("[CouponService] 쿠폰 생성: name={}, discountAmount={}", request.name(), request.discountAmount()); } @@ -59,7 +59,7 @@ public void createIssuedCoupon(CouponIssueRequest request) { List members = memberRepository.findAllById(request.memberIds()); List issuedCoupons = members.stream() - .map(member -> IssuedCoupon.issue(coupon, member)) + .map(member -> IssuedCoupon.create(coupon, member)) .toList(); issuedCouponRepository.saveAll(issuedCoupons); diff --git a/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/Coupon.java b/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/Coupon.java index 939e6d0c2..01eef4ae6 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/Coupon.java +++ b/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/Coupon.java @@ -37,7 +37,7 @@ private Coupon(String name, Money discountAmount) { this.discountAmount = discountAmount; } - public static Coupon createCoupon(String name, Money discountAmount) { + public static Coupon create(String name, Money discountAmount) { validateDiscountAmountPositive(discountAmount); return Coupon.builder().name(name).discountAmount(discountAmount).build(); } diff --git a/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCoupon.java b/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCoupon.java index dd9794460..b0f05b935 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCoupon.java +++ b/src/main/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCoupon.java @@ -51,7 +51,7 @@ private IssuedCoupon(Coupon coupon, Member member, Boolean hasRevoked) { this.hasRevoked = hasRevoked; } - public static IssuedCoupon issue(Coupon coupon, Member member) { + public static IssuedCoupon create(Coupon coupon, Member member) { return IssuedCoupon.builder() .coupon(coupon) .member(member) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/application/TestMemberService.java b/src/main/java/com/gdschongik/gdsc/domain/member/application/TestMemberService.java index d30703784..5f77e6101 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/application/TestMemberService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/application/TestMemberService.java @@ -31,7 +31,7 @@ public void createTestMember(String githubHandle) { throw new CustomException(INTERNAL_SERVER_ERROR); } - Member guestMember = Member.createGuestMember(githubOauthId); + Member guestMember = Member.createGuest(githubOauthId); memberRepository.save(guestMember); } diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/domain/Member.java b/src/main/java/com/gdschongik/gdsc/domain/member/domain/Member.java index f292555fc..c9fc17235 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/domain/Member.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/domain/Member.java @@ -106,7 +106,7 @@ private Member( this.associateRequirement = associateRequirement; } - public static Member createGuestMember(String oauthId) { + public static Member createGuest(String oauthId) { AssociateRequirement associateRequirement = AssociateRequirement.unsatisfied(); return Member.builder() .oauthId(oauthId) diff --git a/src/main/java/com/gdschongik/gdsc/domain/membership/application/MembershipService.java b/src/main/java/com/gdschongik/gdsc/domain/membership/application/MembershipService.java index c0a0aa474..ef5e535de 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/membership/application/MembershipService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/membership/application/MembershipService.java @@ -69,7 +69,7 @@ public void submitMembership(Long recruitmentRoundId) { membershipValidator.validateMembershipSubmit(currentMember, recruitmentRound, isMembershipDuplicate); - Membership membership = Membership.createMembership(currentMember, recruitmentRound); + Membership membership = Membership.create(currentMember, recruitmentRound); membershipRepository.save(membership); log.info("[MembershipService] 멤버십 가입 신청 접수: membershipId = {}", membership.getId()); diff --git a/src/main/java/com/gdschongik/gdsc/domain/membership/domain/Membership.java b/src/main/java/com/gdschongik/gdsc/domain/membership/domain/Membership.java index ef140505d..1dac952e2 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/membership/domain/Membership.java +++ b/src/main/java/com/gdschongik/gdsc/domain/membership/domain/Membership.java @@ -52,7 +52,7 @@ private Membership(Member member, RecruitmentRound recruitmentRound, RegularRequ this.regularRequirement = regularRequirement; } - public static Membership createMembership(Member member, RecruitmentRound recruitmentRound) { + public static Membership create(Member member, RecruitmentRound recruitmentRound) { return Membership.builder() .member(member) .recruitmentRound(recruitmentRound) diff --git a/src/main/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentService.java b/src/main/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentService.java index ae8dfc12b..8f6b2dbd6 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentService.java @@ -40,7 +40,7 @@ public void createRecruitment(RecruitmentCreateRequest request) { recruitmentValidator.validateRecruitmentCreate(isRecruitmentOverlap); - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( request.academicYear(), request.semesterType(), Money.from(request.fee()), diff --git a/src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/Recruitment.java b/src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/Recruitment.java index 50061a394..83d62f053 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/Recruitment.java +++ b/src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/Recruitment.java @@ -37,7 +37,7 @@ private Recruitment( this.semesterPeriod = semesterPeriod; } - public static Recruitment createRecruitment( + public static Recruitment create( Integer academicYear, SemesterType semesterType, Money fee, String feeName, Period semesterPeriod) { return Recruitment.builder() .academicYear(academicYear) diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java index 0988720a0..b93947da0 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java @@ -131,8 +131,7 @@ public void createStudyAnnouncement(Long studyId, StudyAnnouncementCreateUpdateR studyValidator.validateStudyMentor(currentMember, study); - StudyAnnouncement studyAnnouncement = - StudyAnnouncement.createStudyAnnouncement(study, request.title(), request.link()); + StudyAnnouncement studyAnnouncement = StudyAnnouncement.create(study, request.title(), request.link()); studyAnnouncementRepository.save(studyAnnouncement); log.info("[MentorStudyService] 스터디 공지 생성: studyAnnouncementId={}", studyAnnouncement.getId()); diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/domain/Study.java b/src/main/java/com/gdschongik/gdsc/domain/study/domain/Study.java index 9c21258ad..a2137bf00 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/domain/Study.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/domain/Study.java @@ -102,7 +102,7 @@ private Study( this.endTime = endTime; } - public static Study createStudy( + public static Study create( Integer academicYear, SemesterType semesterType, String title, diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyAnnouncement.java b/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyAnnouncement.java index f10470bc8..0e6a24dce 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyAnnouncement.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyAnnouncement.java @@ -40,7 +40,7 @@ public StudyAnnouncement(Study study, String title, String link) { this.link = link; } - public static StudyAnnouncement createStudyAnnouncement(Study study, String title, String link) { + public static StudyAnnouncement create(Study study, String title, String link) { return StudyAnnouncement.builder().study(study).title(title).link(link).build(); } diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/factory/StudyDomainFactory.java b/src/main/java/com/gdschongik/gdsc/domain/study/factory/StudyDomainFactory.java index c5def5746..bac2492c7 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/factory/StudyDomainFactory.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/factory/StudyDomainFactory.java @@ -17,7 +17,7 @@ public class StudyDomainFactory { // 새로운 스터디를 생성합니다. public Study createNewStudy(StudyCreateRequest request, Member mentor) { LocalDate endDate = request.startDate().plusWeeks(request.totalWeek()).minusDays(1); - return Study.createStudy( + return Study.create( request.academicYear(), request.semesterType(), request.title(), diff --git a/src/main/java/com/gdschongik/gdsc/global/security/CustomUserService.java b/src/main/java/com/gdschongik/gdsc/global/security/CustomUserService.java index 0edf0fed8..1472d2c46 100644 --- a/src/main/java/com/gdschongik/gdsc/global/security/CustomUserService.java +++ b/src/main/java/com/gdschongik/gdsc/global/security/CustomUserService.java @@ -1,7 +1,5 @@ package com.gdschongik.gdsc.global.security; -import static com.gdschongik.gdsc.global.common.constant.SecurityConstant.*; - import com.gdschongik.gdsc.domain.member.dao.MemberRepository; import com.gdschongik.gdsc.domain.member.domain.Member; import lombok.RequiredArgsConstructor; @@ -33,7 +31,7 @@ private Member fetchOrCreate(OAuth2User oAuth2User) { } private Member registerMember(OAuth2User oAuth2User) { - Member guest = Member.createGuestMember(oAuth2User.getName()); + Member guest = Member.createGuest(oAuth2User.getName()); return memberRepository.save(guest); } } diff --git a/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/CouponTest.java b/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/CouponTest.java index 72e2b8879..c61c15474 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/CouponTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/CouponTest.java @@ -18,7 +18,7 @@ class 쿠폰_생성할때 { @Test void 성공한다() { // when - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); // then assertThat(coupon).isNotNull(); @@ -30,7 +30,7 @@ class 쿠폰_생성할때 { Money discountAmount = Money.from(ZERO); // when & then - assertThatThrownBy(() -> Coupon.createCoupon(COUPON_NAME, discountAmount)) + assertThatThrownBy(() -> Coupon.create(COUPON_NAME, discountAmount)) .isInstanceOf(CustomException.class) .hasMessageContaining(COUPON_DISCOUNT_AMOUNT_NOT_POSITIVE.getMessage()); } diff --git a/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCouponTest.java b/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCouponTest.java index d5df0341f..b2887995e 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCouponTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/coupon/domain/IssuedCouponTest.java @@ -20,9 +20,9 @@ class 발급쿠폰_사용할때 { @Test void 성공하면_사용여부는_true이다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); // when issuedCoupon.use(); @@ -34,9 +34,9 @@ class 발급쿠폰_사용할때 { @Test void 이미_사용한_쿠폰이면_실패한다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); issuedCoupon.use(); // when & then @@ -48,9 +48,9 @@ class 발급쿠폰_사용할때 { @Test void 이미_회수한_쿠폰이면_실패한다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); issuedCoupon.revoke(); // when & then @@ -66,9 +66,9 @@ class 발급쿠폰_회수할때 { @Test void 성공하면_회수여부는_true이다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); // when issuedCoupon.revoke(); @@ -80,9 +80,9 @@ class 발급쿠폰_회수할때 { @Test void 이미_회수한_발급쿠폰이면_실패한다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); issuedCoupon.revoke(); // when & then @@ -94,9 +94,9 @@ class 발급쿠폰_회수할때 { @Test void 이미_사용한_발급쿠폰이면_실패한다() { // given - Coupon coupon = Coupon.createCoupon(COUPON_NAME, Money.from(ONE)); - Member member = Member.createGuestMember(OAUTH_ID); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create(COUPON_NAME, Money.from(ONE)); + Member member = Member.createGuest(OAUTH_ID); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); issuedCoupon.use(); // when & then diff --git a/src/test/java/com/gdschongik/gdsc/domain/member/application/AdminMemberServiceTest.java b/src/test/java/com/gdschongik/gdsc/domain/member/application/AdminMemberServiceTest.java index 534c28729..2bb86d21d 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/member/application/AdminMemberServiceTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/member/application/AdminMemberServiceTest.java @@ -24,7 +24,7 @@ class AdminMemberServiceTest extends IntegrationTest { @Test void status가_DELETED라면_예외_발생() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.withdraw(); memberRepository.save(member); diff --git a/src/test/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberServiceTest.java b/src/test/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberServiceTest.java index d7bfb9238..112608f75 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberServiceTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberServiceTest.java @@ -52,7 +52,7 @@ void setUp() { @Test void 기본정보_미작성시_멤버_기본정보는_모두_null이다() { // given - memberRepository.save(Member.createGuestMember(OAUTH_ID)); + memberRepository.save(Member.createGuest(OAUTH_ID)); logoutAndReloginAs(1L, MemberRole.ASSOCIATE); // when diff --git a/src/test/java/com/gdschongik/gdsc/domain/member/dao/MemberRepositoryTest.java b/src/test/java/com/gdschongik/gdsc/domain/member/dao/MemberRepositoryTest.java index 61a25a03a..90e061be4 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/member/dao/MemberRepositoryTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/member/dao/MemberRepositoryTest.java @@ -27,7 +27,7 @@ class MemberRepositoryTest extends RepositoryTest { private MemberRepository memberRepository; private Member getMember() { - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); return memberRepository.save(member); } diff --git a/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberTest.java b/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberTest.java index 5904d96df..0cc6615bb 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberTest.java @@ -20,7 +20,7 @@ class 게스트_회원가입시 { @Test void MemberRole은_GUEST이다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when MemberRole role = member.getRole(); @@ -32,7 +32,7 @@ class 게스트_회원가입시 { @Test void MemberStatus는_NORMAL이다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when MemberStatus status = member.getStatus(); @@ -44,7 +44,7 @@ class 게스트_회원가입시 { @Test void 모든_준회원_가입조건은_인증되지_않은_상태이다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when AssociateRequirement requirement = member.getAssociateRequirement(); @@ -63,7 +63,7 @@ class 준회원_가입조건_인증시도시 { @Test void 기본회원정보_작성시_준회원_가입조건중_기본정보_인증상태가_인증된다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); @@ -76,7 +76,7 @@ class 준회원_가입조건_인증시도시 { @Test void 재학생이메일_인증시_준회원_가입조건중_재학생이메일_인증상태가_인증된다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when member.completeUnivEmailVerification(UNIV_EMAIL); @@ -89,7 +89,7 @@ class 준회원_가입조건_인증시도시 { @Test void 디스코드_인증시_준회원_가입조건중_디스코드_인증상태가_인증된다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when member.verifyDiscord(DISCORD_USERNAME, NICKNAME); @@ -102,7 +102,7 @@ class 준회원_가입조건_인증시도시 { @Test void Bevy_인증시_준회원_가입조건중_Bevy_인증상태가_인증된다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when member.verifyBevy(); @@ -119,7 +119,7 @@ class 준회원으로_승급시도시 { @Test void 기본_회원정보_작성하지_않았으면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.verifyDiscord(DISCORD_USERNAME, NICKNAME); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -134,7 +134,7 @@ class 준회원으로_승급시도시 { @Test void 디스코드_인증하지_않았으면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -149,7 +149,7 @@ class 준회원으로_승급시도시 { @Test void Bevy_연동하지_않았으면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -164,7 +164,7 @@ class 준회원으로_승급시도시 { @Test void 이미_준회원으로_승급_돼있으면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -181,7 +181,7 @@ class 준회원으로_승급시도시 { @Test void 모든_준회원_가입조건이_인증되었으면_성공한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -202,7 +202,7 @@ class 회원탈퇴시 { @Test void 이미_탈퇴한_유저면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.withdraw(); @@ -215,7 +215,7 @@ class 회원탈퇴시 { @Test void 회원탈퇴시_이전에_탈퇴하지_않은_유저면_성공한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when member.withdraw(); @@ -230,7 +230,7 @@ class 회원수정시 { @Test void 탈퇴하지_않은_유저면_성공한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateMemberInfo( MODIFIED_STUDENT_ID, NAME, PHONE_NUMBER, D022, UNIV_EMAIL, DISCORD_USERNAME, NICKNAME); @@ -242,7 +242,7 @@ class 회원수정시 { @Test void 탈퇴한_유저면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.withdraw(); @@ -259,7 +259,7 @@ class 회원수정시 { @Test void 디스코드인증시_탈퇴한_유저면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.withdraw(); @@ -274,7 +274,7 @@ class 회원수정시 { @Test void Bevy인증시_탈퇴한_유저면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.withdraw(); @@ -289,7 +289,7 @@ class 정회원으로_승급_시도시 { @Test void 이미_정회원이라면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -307,7 +307,7 @@ class 정회원으로_승급_시도시 { @Test void MemberRole이_GUEST_이라면_실패한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); // when & then assertThatThrownBy(member::advanceToRegular) @@ -318,7 +318,7 @@ class 정회원으로_승급_시도시 { @Test void 준회원이라면_성공한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -340,7 +340,7 @@ class 비회원으로_강등시 { @Test void 성공한다() { // given - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); diff --git a/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberValidatorTest.java b/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberValidatorTest.java index cc97e3354..f4b4dee4d 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberValidatorTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/member/domain/MemberValidatorTest.java @@ -25,7 +25,7 @@ class 준회원으로_일괄_강등시 { void 해당_학기에_이미_시작된_모집기간이_있다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); LocalDateTime now = LocalDateTime.now(); RecruitmentRound recruitmentRound = RecruitmentRound.create( RECRUITMENT_ROUND_NAME, Period.of(now.minusDays(1), now.plusDays(1)), recruitment, ROUND_TYPE); diff --git a/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipTest.java b/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipTest.java index 3c929245b..bcbfe0a96 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipTest.java @@ -22,20 +22,20 @@ class 멤버십_가입신청시 { @Test void 성공한다() { // given - Member member = createGuestMember(OAUTH_ID); + Member member = createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); member.verifyDiscord(DISCORD_USERNAME, NICKNAME); member.verifyBevy(); member.advanceToAssociate(); - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE)); RecruitmentRound recruitmentRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); // when - Membership membership = Membership.createMembership(member, recruitmentRound); + Membership membership = Membership.create(member, recruitmentRound); // then assertThat(membership).isNotNull(); diff --git a/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipValidatorTest.java b/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipValidatorTest.java index 9aeb8d811..eb8495117 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipValidatorTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/membership/domain/MembershipValidatorTest.java @@ -25,7 +25,7 @@ class MembershipValidatorTest { MembershipValidator membershipValidator = new MembershipValidator(); private Member createAssociateMember(Long id) { - Member member = createGuestMember(OAUTH_ID); + Member member = createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); member.verifyDiscord(DISCORD_USERNAME, NICKNAME); @@ -41,7 +41,7 @@ private RecruitmentRound createRecruitmentRound( Money fee, LocalDateTime startDate, LocalDateTime endDate) { - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( academicYear, semesterType, fee, FEE_NAME, Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE)); return RecruitmentRound.create(RECRUITMENT_ROUND_NAME, Period.of(startDate, endDate), recruitment, ROUND_TYPE); } @@ -52,7 +52,7 @@ class 멤버십_가입신청시 { @Test void 역할이_GUEST라면_멤버십_가입신청에_실패한다() { // given - Member member = createGuestMember(OAUTH_ID); + Member member = createGuest(OAUTH_ID); RecruitmentRound recruitmentRound = createRecruitmentRound(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, START_DATE, END_DATE); @@ -85,7 +85,7 @@ class 멤버십_가입신청시 { RecruitmentRound recruitmentRound = createRecruitmentRound(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, START_DATE, END_DATE); - Membership membership = Membership.createMembership(member, recruitmentRound); + Membership membership = Membership.create(member, recruitmentRound); // when & then assertThatThrownBy(() -> membershipValidator.validateMembershipSubmit(member, recruitmentRound, true)) diff --git a/src/test/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentServiceTest.java b/src/test/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentServiceTest.java index 1dd8e1657..8225bf2aa 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentServiceTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/recruitment/application/AdminRecruitmentServiceTest.java @@ -70,8 +70,8 @@ class 모집회차_수정시 { void 성공한다() { // given LocalDateTime now = LocalDateTime.now().withNano(0); - Recruitment recruitment = Recruitment.createRecruitment( - ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.of(now, now.plusMonths(3))); + Recruitment recruitment = + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.of(now, now.plusMonths(3))); recruitmentRepository.save(recruitment); RecruitmentRound recruitmentRound = RecruitmentRound.create( diff --git a/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidatorTest.java b/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidatorTest.java index f9d23a583..72e34ec91 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidatorTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidatorTest.java @@ -24,7 +24,7 @@ class 모집회차_생성시 { @Test void 모집_시작일과_종료일의_연도가_입력된_학년도와_다르다면_실패한다() { // given - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( 2025, SEMESTER_TYPE, FEE, @@ -41,7 +41,7 @@ class 모집회차_생성시 { @Test void 학기_시작일과_종료일의_학기가_입력된_학기와_다르다면_실패한다() { // given - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( ACADEMIC_YEAR, SemesterType.SECOND, FEE, @@ -59,7 +59,7 @@ class 모집회차_생성시 { void 모집_시작일과_종료일이_학기_시작일로부터_2주_이내에_있지_않다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); // when & then assertThatThrownBy(() -> recruitmentRoundValidator.validateRecruitmentRoundCreate( @@ -72,7 +72,7 @@ class 모집회차_생성시 { void 학년도_학기_차수가_모두_중복되면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound recruitmentRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -92,7 +92,7 @@ class 모집회차_생성시 { void RoundType_1차가_없을때_2차를_생성하려_하면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); // when & then assertThatThrownBy(() -> recruitmentRoundValidator.validateRecruitmentRoundCreate( @@ -105,7 +105,7 @@ class 모집회차_생성시 { void 기간이_중복되는_모집회차가_있다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound recruitmentRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -125,7 +125,7 @@ class 모집회차_수정시 { void 기간이_중복되는_모집회차가_있다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound firstRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -146,7 +146,7 @@ class 모집회차_수정시 { void 차수가_중복되는_모집회차가_있다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound firstRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -167,7 +167,7 @@ class 모집회차_수정시 { void 모집_시작일과_종료일이_학기_시작일로부터_2주_이내에_있지_않다면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound firstRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -184,7 +184,7 @@ class 모집회차_수정시 { void RoundType_1차를_2차로_수정하려_하면_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound firstRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); @@ -201,7 +201,7 @@ class 모집회차_수정시 { void 모집_시작일이_지났다면_수정_실패한다() { // given Recruitment recruitment = - Recruitment.createRecruitment(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); + Recruitment.create(ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, START_TO_END_PERIOD); RecruitmentRound recruitmentRound = RecruitmentRound.create(RECRUITMENT_ROUND_NAME, START_TO_END_PERIOD, recruitment, ROUND_TYPE); diff --git a/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentTest.java b/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentTest.java index 08f9ac0a8..b131ef500 100644 --- a/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentTest.java +++ b/src/test/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentTest.java @@ -18,7 +18,7 @@ class 학기생성시 { Period period = Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE); // when - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( ACADEMIC_YEAR, SEMESTER_TYPE, FEE, FEE_NAME, Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE)); // then 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 b19ba13f4..4ad001fed 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 @@ -1,7 +1,7 @@ package com.gdschongik.gdsc.domain.study.domain; import static com.gdschongik.gdsc.domain.member.domain.Department.D022; -import static com.gdschongik.gdsc.domain.member.domain.Member.createGuestMember; +import static com.gdschongik.gdsc.domain.member.domain.Member.createGuest; import static com.gdschongik.gdsc.global.common.constant.MemberConstant.*; import static com.gdschongik.gdsc.global.common.constant.RecruitmentConstant.*; import static com.gdschongik.gdsc.global.common.constant.StudyConstant.*; @@ -20,7 +20,7 @@ public class StudyTest { private Member createAssociateMember(Long id) { - Member member = createGuestMember(OAUTH_ID); + Member member = createGuest(OAUTH_ID); member.updateBasicMemberInfo(STUDENT_ID, NAME, PHONE_NUMBER, D022, EMAIL); member.completeUnivEmailVerification(UNIV_EMAIL); member.verifyDiscord(DISCORD_USERNAME, NICKNAME); @@ -36,11 +36,11 @@ class 스터디_개설시 { @Test void 게스트인_회원을_멘토로_지정하면_실패한다() { // given - Member guestMember = Member.createGuestMember(OAUTH_ID); + Member guestMember = Member.createGuest(OAUTH_ID); Period applicationPeriod = Period.of(START_DATE.minusDays(10), START_DATE.minusDays(5)); // when & then - assertThatThrownBy(() -> Study.createStudy( + assertThatThrownBy(() -> Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, @@ -64,7 +64,7 @@ class 스터디_개설시 { Period applicationPeriod = Period.of(START_DATE.plusDays(1), START_DATE.plusDays(2)); // when & then - assertThatThrownBy(() -> Study.createStudy( + assertThatThrownBy(() -> Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, @@ -88,7 +88,7 @@ class 스터디_개설시 { Period applicationPeriod = Period.of(START_DATE.minusDays(5), START_DATE.plusDays(3)); // when & then - assertThatThrownBy(() -> Study.createStudy( + assertThatThrownBy(() -> Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, @@ -114,7 +114,7 @@ class 스터디_개설시 { LocalTime studyEndTime = STUDY_START_TIME.minusHours(2); // when & then - assertThatThrownBy(() -> Study.createStudy( + assertThatThrownBy(() -> Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, @@ -140,7 +140,7 @@ class 스터디_개설시 { LocalTime studyEndTime = STUDY_END_TIME; // when & then - assertThatThrownBy(() -> Study.createStudy( + assertThatThrownBy(() -> Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, diff --git a/src/test/java/com/gdschongik/gdsc/helper/FixtureHelper.java b/src/test/java/com/gdschongik/gdsc/helper/FixtureHelper.java index a2917a61e..1f64b54ac 100644 --- a/src/test/java/com/gdschongik/gdsc/helper/FixtureHelper.java +++ b/src/test/java/com/gdschongik/gdsc/helper/FixtureHelper.java @@ -26,7 +26,7 @@ public class FixtureHelper { public Member createGuestMember(Long id) { - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); ReflectionTestUtils.setField(member, "id", id); return member; } @@ -66,7 +66,7 @@ public RecruitmentRound createRecruitmentRound( Integer academicYear, SemesterType semesterType, Money fee) { - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( academicYear, semesterType, fee, FEE_NAME, Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE)); return RecruitmentRound.create( @@ -74,16 +74,16 @@ public RecruitmentRound createRecruitmentRound( } public Membership createMembership(Member member, RecruitmentRound recruitmentRound) { - return Membership.createMembership(member, recruitmentRound); + return Membership.create(member, recruitmentRound); } public IssuedCoupon createAndIssue(Money money, Member member) { - Coupon coupon = Coupon.createCoupon("테스트쿠폰", money); - return IssuedCoupon.issue(coupon, member); + Coupon coupon = Coupon.create("테스트쿠폰", money); + return IssuedCoupon.create(coupon, member); } public Study createStudy(Member mentor, Period period, Period applicationPeriod) { - return Study.createStudy( + return Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, diff --git a/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java b/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java index 41fc1b2e3..06ed3515b 100644 --- a/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java +++ b/src/test/java/com/gdschongik/gdsc/helper/IntegrationTest.java @@ -145,7 +145,7 @@ protected void logoutAndReloginAs(Long memberId, MemberRole memberRole) { } protected Member createMember() { - Member member = Member.createGuestMember(OAUTH_ID); + Member member = Member.createGuest(OAUTH_ID); memberRepository.save(member); member.completeUnivEmailVerification(UNIV_EMAIL); @@ -158,7 +158,7 @@ protected Member createMember() { } protected Member createGuestMember() { - Member guestMember = Member.createGuestMember(OAUTH_ID); + Member guestMember = Member.createGuest(OAUTH_ID); return memberRepository.save(guestMember); } @@ -211,25 +211,25 @@ protected RecruitmentRound createRecruitmentRound( } protected Recruitment createRecruitment(Integer academicYear, SemesterType semesterType, Money fee) { - Recruitment recruitment = Recruitment.createRecruitment( + Recruitment recruitment = Recruitment.create( academicYear, semesterType, fee, FEE_NAME, Period.of(SEMESTER_START_DATE, SEMESTER_END_DATE)); return recruitmentRepository.save(recruitment); } protected Membership createMembership(Member member, RecruitmentRound recruitmentRound) { - Membership membership = Membership.createMembership(member, recruitmentRound); + Membership membership = Membership.create(member, recruitmentRound); return membershipRepository.save(membership); } protected IssuedCoupon createAndIssue(Money money, Member member) { - Coupon coupon = Coupon.createCoupon("테스트쿠폰", money); + Coupon coupon = Coupon.create("테스트쿠폰", money); couponRepository.save(coupon); - IssuedCoupon issuedCoupon = IssuedCoupon.issue(coupon, member); + IssuedCoupon issuedCoupon = IssuedCoupon.create(coupon, member); return issuedCouponRepository.save(issuedCoupon); } protected Study createStudy(Member mentor, Period period, Period applicationPeriod) { - Study study = Study.createStudy( + Study study = Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE, @@ -246,7 +246,7 @@ protected Study createStudy(Member mentor, Period period, Period applicationPeri } protected Study createNewStudy(Member mentor, Long totalWeek, Period period, Period applicationPeriod) { - Study study = Study.createStudy( + Study study = Study.create( ACADEMIC_YEAR, SEMESTER_TYPE, STUDY_TITLE,