diff --git a/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorChangeRequest.java b/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorChangeRequest.java index 38e56512..a22dd2e2 100644 --- a/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorChangeRequest.java +++ b/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorChangeRequest.java @@ -3,5 +3,5 @@ import jakarta.validation.constraints.NotBlank; public record SeniorChangeRequest(@NotBlank String major, @NotBlank String postgradu, @NotBlank String professor, - @NotBlank String lab, @NotBlank String field, @NotBlank String keyword) { + @NotBlank String lab, @NotBlank String field, @NotBlank String keyword, @NotBlank String chatLink) { } \ No newline at end of file diff --git a/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorSignUpRequest.java b/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorSignUpRequest.java index 58fe9563..21cceaef 100644 --- a/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorSignUpRequest.java +++ b/src/main/java/com/postgraduate/domain/auth/application/dto/req/SeniorSignUpRequest.java @@ -8,5 +8,5 @@ public record SeniorSignUpRequest(@NotNull Long socialId, @NotBlank String phone @Size(max = 6, message = "6글자까지 입력 가능합니다.") @NotBlank String nickName, Boolean marketingReceive, @NotBlank String major, @NotBlank String postgradu, @NotBlank String professor, @NotBlank String lab, @NotBlank String field, - @NotBlank String keyword) { + @NotBlank String keyword, @NotBlank String chatLink) { } diff --git a/src/main/java/com/postgraduate/domain/mentoring/application/mapper/MentoringMapper.java b/src/main/java/com/postgraduate/domain/mentoring/application/mapper/MentoringMapper.java index 9dbdc076..bc805454 100644 --- a/src/main/java/com/postgraduate/domain/mentoring/application/mapper/MentoringMapper.java +++ b/src/main/java/com/postgraduate/domain/mentoring/application/mapper/MentoringMapper.java @@ -8,7 +8,6 @@ import com.postgraduate.domain.payment.domain.entity.Payment; import com.postgraduate.domain.salary.domain.entity.Salary; import com.postgraduate.domain.senior.domain.entity.Info; -import com.postgraduate.domain.senior.domain.entity.Profile; import com.postgraduate.domain.senior.domain.entity.Senior; import com.postgraduate.domain.user.domain.entity.User; @@ -21,7 +20,6 @@ public static ExpectedMentoringInfo mapToExpectedInfo(Mentoring mentoring) { Senior senior = mentoring.getSenior(); User user = senior.getUser(); Info info = senior.getInfo(); - Profile profile = senior.getProfile(); return new ExpectedMentoringInfo( mentoring.getMentoringId(), senior.getSeniorId(), @@ -32,7 +30,7 @@ public static ExpectedMentoringInfo mapToExpectedInfo(Mentoring mentoring) { info.getLab(), mentoring.getDate(), mentoring.getTerm(), - profile.getChatLink() + info.getChatLink() ); } diff --git a/src/main/java/com/postgraduate/domain/senior/application/dto/req/SeniorProfileRequest.java b/src/main/java/com/postgraduate/domain/senior/application/dto/req/SeniorProfileRequest.java index a85f93ac..2c7b08ef 100644 --- a/src/main/java/com/postgraduate/domain/senior/application/dto/req/SeniorProfileRequest.java +++ b/src/main/java/com/postgraduate/domain/senior/application/dto/req/SeniorProfileRequest.java @@ -12,8 +12,6 @@ public record SeniorProfileRequest( @NotBlank String target, @NotBlank - String chatLink, - @NotBlank String oneLiner, @NotEmpty List times diff --git a/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java b/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java index 4b4fa803..a8587005 100644 --- a/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java +++ b/src/main/java/com/postgraduate/domain/senior/application/mapper/SeniorMapper.java @@ -44,95 +44,73 @@ public static Senior mapToSenior(User user, SeniorChangeRequest request) { } private static Info mapToInfo(SeniorSignUpRequest request) { - String[] fields = request.field().split(","); - Set fieldNames = Field.fieldNames(); - Set postgraduNames = Postgradu.postgraduNames(); - - Info.InfoBuilder infoBuilder = Info.builder() + return Info.builder() .major(request.major()) .postgradu(request.postgradu()) .professor(request.professor()) .lab(request.lab()) .keyword(request.keyword()) .field(request.field()) - .etcPostgradu(false) - .etcField(false) + .etcPostgradu(checkEtcPostgradu(request.postgradu())) + .etcField(checkEtcField(request.field())) + .chatLink(request.chatLink()) .totalInfo(request.major() + request.lab() + request.field() - + request.professor() + request.postgradu() + request.keyword()); - - for (String field : fields) { - if (!fieldNames.contains(field)) { - infoBuilder.etcField(true); - break; - } - } - if (!postgraduNames.contains(request.postgradu())) - infoBuilder.etcPostgradu(true); - - return infoBuilder.build(); + + request.professor() + request.postgradu() + request.keyword()) + .build(); } private static Info mapToInfo(SeniorChangeRequest request) { - String[] fields = request.field().split(","); - Set fieldNames = Field.fieldNames(); - Set postgraduNames = Postgradu.postgraduNames(); - - Info.InfoBuilder infoBuilder = Info.builder() + return Info.builder() .major(request.major()) .postgradu(request.postgradu()) .professor(request.professor()) .lab(request.lab()) .keyword(request.keyword()) .field(request.field()) - .etcPostgradu(false) - .etcField(false) + .etcPostgradu(checkEtcPostgradu(request.postgradu())) + .etcField(checkEtcField(request.field())) + .chatLink(request.chatLink()) .totalInfo(request.major() + request.lab() + request.field() - + request.professor() + request.postgradu() + request.keyword()); - - for (String field : fields) { - if (!fieldNames.contains(field)) { - infoBuilder.etcField(true); - break; - } - } - if (!postgraduNames.contains(request.postgradu())) - infoBuilder.etcPostgradu(true); - - return infoBuilder.build(); + + request.professor() + request.postgradu() + request.keyword()) + .build(); } public static Info mapToInfo(Senior senior, SeniorMyPageProfileRequest request) { Info info = senior.getInfo(); - String[] fields = request.field().split(","); - Set fieldNames = Field.fieldNames(); - Info.InfoBuilder infoBuilder = Info.builder() + return Info.builder() .major(info.getMajor()) .postgradu(info.getPostgradu()) .professor(info.getProfessor()) .lab(request.lab()) .keyword(request.keyword()) .field(request.field()) - .etcPostgradu(false) - .etcField(false) + .etcPostgradu(info.getEtcPostgradu()) + .etcField(checkEtcField(request.field())) + .chatLink(request.chatLink()) .totalInfo(info.getMajor() + request.lab() + request.field() - + info.getProfessor() + info.getPostgradu() + request.keyword()); + + info.getProfessor() + info.getPostgradu() + request.keyword()) + .build(); + } + private static boolean checkEtcField(String requestField) { + String[] fields = requestField.split(","); + Set fieldNames = Field.fieldNames(); for (String field : fields) { - if (!fieldNames.contains(field)) { - infoBuilder.etcField(true); - break; - } + if (!fieldNames.contains(field)) + return true; } - infoBuilder.etcPostgradu(info.getEtcPostgradu()); + return false; + } - return infoBuilder.build(); + private static boolean checkEtcPostgradu(String postgradu) { + Set postgraduNames = Postgradu.postgraduNames(); + return !postgraduNames.contains(postgradu); } public static Profile mapToProfile(SeniorProfileRequest profileRequest) { return Profile.builder() .info(profileRequest.info()) - .chatLink(profileRequest.chatLink()) .oneLiner(profileRequest.oneLiner()) .target(profileRequest.target()) .build(); @@ -141,7 +119,6 @@ public static Profile mapToProfile(SeniorProfileRequest profileRequest) { public static Profile mapToProfile(SeniorMyPageProfileRequest profileRequest) { return Profile.builder() .info(profileRequest.info()) - .chatLink(profileRequest.chatLink()) .oneLiner(profileRequest.oneLiner()) .target(profileRequest.target()) .build(); @@ -162,7 +139,7 @@ public static SeniorMyPageProfileResponse mapToMyPageProfile(Senior senior, List keyword, profile.getInfo(), profile.getTarget(), - profile.getChatLink(), + info.getChatLink(), field, profile.getOneLiner(), times @@ -178,7 +155,7 @@ public static SeniorMyPageProfileResponse mapToMyPageProfile(Senior senior) { keyword, null, null, - null, + info.getChatLink(), field, null, null @@ -213,7 +190,7 @@ public static SeniorDetailResponse mapToSeniorDetail(Senior senior, List { - String chatLink = senior.getProfile().getChatLink(); + String chatLink = senior.getInfo().getChatLink(); return mapper.mapToJuniorAcceptMessage(user, chatLink, time); }); } diff --git a/src/main/java/com/postgraduate/global/bizppurio/usecase/BizppurioSeniorMessage.java b/src/main/java/com/postgraduate/global/bizppurio/usecase/BizppurioSeniorMessage.java index 742e9c87..caa45b47 100644 --- a/src/main/java/com/postgraduate/global/bizppurio/usecase/BizppurioSeniorMessage.java +++ b/src/main/java/com/postgraduate/global/bizppurio/usecase/BizppurioSeniorMessage.java @@ -25,7 +25,7 @@ public void mentoringApply(User user) { public void mentoringAccept(Senior senior, String time) { bizppurioSend.sendMessageWithExceptionHandling(() -> { User user = senior.getUser(); - String chatLink = senior.getProfile().getChatLink(); + String chatLink = senior.getInfo().getChatLink(); return mapper.mapToSeniorAcceptMessage(user, chatLink, time); }); } diff --git a/src/test/java/com/postgraduate/Integration/AuthControllerTest.java b/src/test/java/com/postgraduate/Integration/AuthControllerTest.java index 72e7c18b..5de6f65e 100644 --- a/src/test/java/com/postgraduate/Integration/AuthControllerTest.java +++ b/src/test/java/com/postgraduate/Integration/AuthControllerTest.java @@ -224,7 +224,7 @@ void singUpSenior() throws Exception { String request = objectMapper.writeValueAsString( new SeniorSignUpRequest(anonymousUserSocialId, "01012345678", "새로운닉네임", true, "전공", "서울대학교", "교수", "연구실", - "AI", "키워드") + "AI", "키워드", "chatLink") ); mvc.perform(post("/auth/senior/signup") @@ -244,7 +244,7 @@ void singUpSenior() throws Exception { void singUpSenior(String empty) throws Exception { String request = objectMapper.writeValueAsString( new SeniorSignUpRequest(anonymousUserSocialId, "01012345678", "새로운닉네임", - true, empty, empty, empty, empty, empty, empty) + true, empty, empty, empty, empty, empty, empty, empty) ); mvc.perform(post("/auth/senior/signup") @@ -262,7 +262,7 @@ void changeSenior() throws Exception { String request = objectMapper.writeValueAsString( new SeniorChangeRequest("major", "field", "교수", "연구실", - "AI", "키워드") + "AI", "키워드", "chatLink") ); mvc.perform(post("/auth/senior/change") @@ -284,7 +284,7 @@ void changeSenior(String empty) throws Exception { String userAccessToken = jwtUtil.generateAccessToken(user.getUserId(), USER); String request = objectMapper.writeValueAsString( - new SeniorChangeRequest(empty, empty, empty, empty, empty, empty) + new SeniorChangeRequest(empty, empty, empty, empty, empty, empty, empty) ); mvc.perform(post("/auth/senior/change") diff --git a/src/test/java/com/postgraduate/Integration/MentoringControllerTest.java b/src/test/java/com/postgraduate/Integration/MentoringControllerTest.java index eb27a91e..0ecf6e89 100644 --- a/src/test/java/com/postgraduate/Integration/MentoringControllerTest.java +++ b/src/test/java/com/postgraduate/Integration/MentoringControllerTest.java @@ -58,8 +58,8 @@ void setUp() throws IOException { User userOfSenior = new User(0L, 2L, "mail", "선배", "012", "profile", 0, Role.SENIOR, true, now(), now(), false); userRepository.save(userOfSenior); - Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2"); - Profile profile = new Profile("저는요", "한줄소개", "대상", "chatLink", 40); + Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2", "chatLink", 30); + Profile profile = new Profile("저는요", "한줄소개", "대상"); senior = new Senior(0L, userOfSenior, "certification", WAITING, 0, info, profile, now(), now()); seniorRepository.save(senior); @@ -296,7 +296,7 @@ void getOtherSeniorMentoringDetail() throws Exception { User otherUser = new User(-1L, 0L, "mail", "다른 후배", "011", "profile", 0, Role.USER, true, now(), now(), false); userRepository.save(otherUser); - Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2"); + Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2", "chatLink", 30); Senior otherSenior = new Senior(-1L, otherUser, "certification", WAITING, 0, info, null, now(), now()); seniorRepository.save(otherSenior); diff --git a/src/test/java/com/postgraduate/Integration/SalaryControllerTest.java b/src/test/java/com/postgraduate/Integration/SalaryControllerTest.java index 9ba5a074..6011c3a1 100644 --- a/src/test/java/com/postgraduate/Integration/SalaryControllerTest.java +++ b/src/test/java/com/postgraduate/Integration/SalaryControllerTest.java @@ -38,8 +38,8 @@ void setUp() throws IOException { User user = new User(0L, 1L, "mail", "후배", "011", "profile", 0, Role.SENIOR, true, now(), now(), false); userRepository.save(user); - Info info = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2"); - Profile profile = new Profile("저는요", "한줄소개", "대상", "chatLink", 40); + Info info = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2", "chatLink", 30); + Profile profile = new Profile("저는요", "한줄소개", "대상"); Senior senior = new Senior(0L, user, "certification", Status.APPROVE, 0, info, profile, now(), now()); seniorRepository.save(senior); diff --git a/src/test/java/com/postgraduate/Integration/SeniorControllerTest.java b/src/test/java/com/postgraduate/Integration/SeniorControllerTest.java index c282e102..27288a5b 100644 --- a/src/test/java/com/postgraduate/Integration/SeniorControllerTest.java +++ b/src/test/java/com/postgraduate/Integration/SeniorControllerTest.java @@ -61,12 +61,12 @@ void setUp() throws IOException { userRepository.save(user); userRepository.save(otherUser); - Info info1 = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2"); - Profile profile1 = new Profile("info", "one", "u", "chat", 30); + Info info1 = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2", "chatLink", 30); + Profile profile1 = new Profile("info", "one", "u"); senior = new Senior(-2L, user, "certification", Status.APPROVE, 0, info1, profile1, now(), now()); seniorRepository.save(senior); - Info info2 = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2"); + Info info2 = new Info("major", "postgradu", "교수님", "keyword1,keyword2", "랩실", "field", false, false, "field,keyword1,keyword2", "chatLink", 30); otherSenior = new Senior(-1L, otherUser, "certification", Status.APPROVE, 0, info2, null, now(), now()); seniorRepository.save(otherSenior); @@ -80,7 +80,7 @@ void setUp() throws IOException { private void updateProfile() { - Profile profile = new Profile("저는요", "한줄소개", "대상", "chatLink", 30); + Profile profile = new Profile("저는요", "한줄소개", "대상"); senior.updateProfile(profile); seniorRepository.save(senior); } @@ -136,7 +136,7 @@ void singUpSenior() throws Exception { new AvailableCreateRequest("토", "10:00", "20:00") ); String request = objectMapper.writeValueAsString( - new SeniorProfileRequest("저는요", "대상", "chatLink", "한줄소개", availableCreateRequests) + new SeniorProfileRequest("저는요", "대상", "한줄소개", availableCreateRequests) ); mvc.perform(patch("/senior/profile") @@ -155,7 +155,7 @@ void singUpSenior() throws Exception { void singUpInvalidSenior(String empty) throws Exception { List availableCreateRequests = new ArrayList<>(); String request = objectMapper.writeValueAsString( - new SeniorProfileRequest(empty, empty, empty, empty, availableCreateRequests) + new SeniorProfileRequest(empty, empty, empty, availableCreateRequests) ); mvc.perform(patch("/senior/profile") @@ -176,7 +176,7 @@ void InvalidDay() throws Exception { ); String request = objectMapper.writeValueAsString( - new SeniorProfileRequest("저는요", "대상", "chatLink", "한줄소개", availableCreateRequests) + new SeniorProfileRequest("저는요", "대상", "chatLink", availableCreateRequests) ); mvc.perform(patch("/senior/profile") @@ -279,7 +279,7 @@ void getEmptySeniorProfile() throws Exception { .andExpect(jsonPath("$.data.keyword").isNotEmpty()) .andExpect(jsonPath("$.data.info").isEmpty()) .andExpect(jsonPath("$.data.target").isEmpty()) - .andExpect(jsonPath("$.data.chatLink").isEmpty()) + .andExpect(jsonPath("$.data.chatLink").isNotEmpty()) .andExpect(jsonPath("$.data.field").isNotEmpty()) .andExpect(jsonPath("$.data.oneLiner").isEmpty()) .andExpect(jsonPath("$.data.times").isEmpty()); diff --git a/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java b/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java index 63e7b156..5b038a9d 100644 --- a/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java @@ -76,8 +76,8 @@ class SignUpUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 40); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(1L, 1234L, "a", "a", "123", "a", 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), FALSE); @@ -121,7 +121,7 @@ void invalidPhoneNumber() { void seniorSignUp() { SeniorSignUpRequest request = new SeniorSignUpRequest(user.getSocialId(), user.getPhoneNumber(), user.getNickName(), user.getMarketingReceive(), info.getMajor(), info.getPostgradu(), info.getProfessor(), info.getLab(), info.getField(), - info.getKeyword()); + info.getKeyword(), info.getChatLink()); User saveUser = signUpUseCase.seniorSignUp(request); @@ -138,7 +138,7 @@ void seniorSignUp() { void invalidKeyword() { SeniorSignUpRequest request = new SeniorSignUpRequest(user.getSocialId(), user.getPhoneNumber(), user.getNickName(), user.getMarketingReceive(), info.getMajor(), info.getPostgradu(), info.getProfessor(), info.getLab(), info.getField(), - info.getKeyword()); + info.getKeyword(), info.getChatLink()); doThrow(KeywordException.class) .when(seniorUtils) @@ -152,7 +152,7 @@ void invalidKeyword() { @DisplayName("선배 변경 테스트") void changeSenior() { SeniorChangeRequest seniorChangeRequest = new SeniorChangeRequest(info.getMajor(), info.getPostgradu(), info.getProfessor(), - info.getLab(), info.getField(), info.getKeyword()); + info.getLab(), info.getField(), info.getKeyword(), info.getChatLink()); given(userGetService.byUserId(user.getUserId())) .willReturn(user); diff --git a/src/test/java/com/postgraduate/domain/auth/presentation/AuthControllerTest.java b/src/test/java/com/postgraduate/domain/auth/presentation/AuthControllerTest.java index 95c08702..b3033fc7 100644 --- a/src/test/java/com/postgraduate/domain/auth/presentation/AuthControllerTest.java +++ b/src/test/java/com/postgraduate/domain/auth/presentation/AuthControllerTest.java @@ -172,7 +172,7 @@ void singUpSenior() throws Exception { String request = objectMapper.writeValueAsString( new SeniorSignUpRequest(user.getSocialId(), "01012345678", "새로운닉네임", true, "전공", "서울대학교", "교수", "연구실", - "AI", "키워드") + "AI", "키워드", "chatLink") ); JwtTokenResponse tokenResponse = new JwtTokenResponse("access", 10, "refresh", 10, USER); @@ -202,7 +202,7 @@ void singUpSenior() throws Exception { void changeSenior() throws Exception { String request = objectMapper.writeValueAsString( new SeniorChangeRequest("major", "field", "교수", "연구실", - "AI", "키워드") + "AI", "키워드", "chatLink") ); JwtTokenResponse tokenResponse = new JwtTokenResponse("access", 10, "refresh", 10, USER); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java index f152171b..6b5bc4e6 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java @@ -71,8 +71,8 @@ class MentoringApplyingUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 30); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(-1L, 1234L, "a", "a", "123", "a", 0, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java index 9606f203..7f2b1d45 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java @@ -97,8 +97,8 @@ class MentoringManageUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 30); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(-1L, 1234L, "a", "a", "123", "a", 0, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java index 0d46a00a..2b6ff171 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java @@ -59,8 +59,8 @@ class MentoringSeniorInfoUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 30); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(-1L, 1234L, "a", "a", "123", "a", 0, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java index c806e764..d4b98e8c 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java @@ -55,8 +55,8 @@ class MentoringUserInfoUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 30); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(-1L, 1234L, "a", "a", "123", "a", 0, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/mentoring/presentation/MentoringControllerTest.java b/src/test/java/com/postgraduate/domain/mentoring/presentation/MentoringControllerTest.java index bda64dfe..a6a15ea3 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/presentation/MentoringControllerTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/presentation/MentoringControllerTest.java @@ -73,7 +73,7 @@ void getWaitingMentorings() throws Exception { @WithMockUser @DisplayName("대학생이 예정된 멘토링 목록을 조회한다") void getExpectedMentorings() throws Exception { - ExpectedMentoringInfo mentoringInfo = new ExpectedMentoringInfo(expectedMentoring.getMentoringId(), senior.getSeniorId(), userOfSenior.getProfile(), userOfSenior.getNickName(), info.getPostgradu(), info.getMajor(), info.getLab(), expectedMentoring.getDate(), expectedMentoring.getTerm(), profile.getChatLink()); + ExpectedMentoringInfo mentoringInfo = new ExpectedMentoringInfo(expectedMentoring.getMentoringId(), senior.getSeniorId(), userOfSenior.getProfile(), userOfSenior.getNickName(), info.getPostgradu(), info.getMajor(), info.getLab(), expectedMentoring.getDate(), expectedMentoring.getTerm(), info.getChatLink()); ExpectedMentoringResponse expectedResponse = new ExpectedMentoringResponse(List.of(mentoringInfo)); given(mentoringUserInfoUseCase.getExpected(any())) .willReturn(expectedResponse); diff --git a/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java index 1b3020f9..8b093cbe 100644 --- a/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java @@ -59,8 +59,8 @@ class PaymentManageUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 30); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(-1L, 1234L, "a", "a", "123", "a", 0, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java index 833e7398..b310378b 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java @@ -53,8 +53,8 @@ class SeniorInfoUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 40); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(1L, 1234L, "a", "a", "123", "a", 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java index ef5d286b..d6ea86c1 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java @@ -82,8 +82,8 @@ class SeniorManageUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 40); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(1L, 1234L, "a", "a", "123", "a", 1, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); @@ -112,8 +112,7 @@ void signUpProfile() { AvailableCreateRequest available3 = new AvailableCreateRequest("수", "12:00", "18:00"); List availableCreateRequests = List.of(available1, available2, available3); SeniorProfileRequest request = new SeniorProfileRequest( - profile.getInfo(), profile.getTarget(), - profile.getChatLink(), profile.getOneLiner(), + profile.getInfo(), profile.getTarget(), profile.getOneLiner(), availableCreateRequests); given(seniorGetService.byUser(user)) diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java index 41ead865..5ad9afa4 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java @@ -63,8 +63,8 @@ class SeniorMyPageUseTypeTest { @BeforeEach void setting() { - info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a"); - profile = new Profile("a", "a", "a", "a", 40); + info = new Info("a", "a", "a", "a", "a", "a", TRUE, TRUE, "a", "chatLink", 30); + profile = new Profile("a", "a", "a"); user = new User(1L, 1234L, "a", "a", "123", "a", 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); @@ -133,12 +133,12 @@ void getSeniorMyPageProfileWithNull() { .isNotEmpty(); assertThat(myPageProfile.keyword()) .isNotEmpty(); + assertThat(myPageProfile.chatLink()) + .isNotEmpty(); assertThat(myPageProfile.info()) .isNull(); assertThat(myPageProfile.target()) .isNull(); - assertThat(myPageProfile.chatLink()) - .isNull(); assertThat(myPageProfile.oneLiner()) .isNull(); assertThat(myPageProfile.times()) diff --git a/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java b/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java index a64eaf7f..45eda6d6 100644 --- a/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java +++ b/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java @@ -39,7 +39,7 @@ void setting() { @Test @DisplayName("profile 업데이트") void seniorProfile() { - Profile profile = new Profile("a", "b", "c", "d", 10); + Profile profile = new Profile("a", "b", "c"); seniorUpdateService.signUpSeniorProfile(senior, profile); Profile changeProfile = senior.getProfile(); @@ -47,12 +47,8 @@ void seniorProfile() { .isEqualTo(profile.getInfo()); assertThat(changeProfile.getOneLiner()) .isEqualTo(profile.getOneLiner()); - assertThat(changeProfile.getChatLink()) - .isEqualTo(profile.getChatLink()); assertThat(changeProfile.getTarget()) .isEqualTo(profile.getTarget()); - assertThat(changeProfile.getTerm()) - .isEqualTo(profile.getTerm()); } @Test @@ -88,15 +84,13 @@ void updateMyPageProfile() { .isEqualTo(request.lab()); assertThat(changeInfo.getField()) .isEqualTo(request.field()); + assertThat(changeInfo.getChatLink()) + .isEqualTo(request.chatLink()); - assertThat(changeProfile.getTerm()) - .isEqualTo(profile.getTerm()); assertThat(changeProfile.getInfo()) .isEqualTo(profile.getInfo()); assertThat(changeProfile.getTarget()) .isEqualTo(profile.getTarget()); - assertThat(changeProfile.getChatLink()) - .isEqualTo(profile.getChatLink()); assertThat(changeProfile.getOneLiner()) .isEqualTo(profile.getOneLiner()); } diff --git a/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java b/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java index 000863b9..2d2c8347 100644 --- a/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java +++ b/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java @@ -89,7 +89,7 @@ void singUpSenior() throws Exception { new AvailableCreateRequest("토", "10:00", "20:00") ); String request = objectMapper.writeValueAsString( - new SeniorProfileRequest("저는요", "대상", "chatLink", "한줄소개", availableCreateRequests) + new SeniorProfileRequest("저는요", "대상", "한줄소개", availableCreateRequests) ); SeniorProfileUpdateResponse response = new SeniorProfileUpdateResponse(senior.getSeniorId()); @@ -161,7 +161,7 @@ void getSeniorProfile() throws Exception { List availableTimeResponses = availables.stream() .map(available -> new AvailableTimeResponse(available.getDay(), available.getStartTime(), available.getEndTime())) .toList(); - SeniorMyPageProfileResponse response = new SeniorMyPageProfileResponse(info.getLab(), info.getKeyword().split(","), profile.getInfo(), profile.getTarget(), profile.getChatLink(), info.getField().split(","), profile.getOneLiner(), availableTimeResponses); + SeniorMyPageProfileResponse response = new SeniorMyPageProfileResponse(info.getLab(), info.getKeyword().split(","), profile.getInfo(), profile.getTarget(), info.getChatLink(), info.getField().split(","), profile.getOneLiner(), availableTimeResponses); given(seniorMyPageUseCase.getSeniorMyPageProfile(any())) .willReturn(response); @@ -287,7 +287,7 @@ void getSeniorDetails(boolean tf) throws Exception { .map(available -> new AvailableTimeResponse(available.getDay(), available.getStartTime(), available.getEndTime())) .toList(); SeniorDetailResponse response = new SeniorDetailResponse( - tf, tf, userOfSenior.getNickName(), profile.getTerm(), userOfSenior.getProfile(), info.getPostgradu(), info.getMajor(), + tf, tf, userOfSenior.getNickName(), info.getTerm(), userOfSenior.getProfile(), info.getPostgradu(), info.getMajor(), info.getLab(), info.getProfessor(), info.getKeyword().split(","), profile.getInfo(), profile.getOneLiner(), profile.getTarget(), availableTimeResponses ); @@ -321,10 +321,9 @@ void getSeniorDetails(boolean tf) throws Exception { @DisplayName("결제 시 대학원생의 기본 정보를 확인한다") void testGetSeniorProfile() throws Exception { Info info = senior.getInfo(); - Profile profile = senior.getProfile(); SeniorProfileResponse response = new SeniorProfileResponse( userOfSenior.getNickName(), userOfSenior.getProfile(), - info.getPostgradu(),info.getMajor(), info.getLab(), profile.getTerm(), + info.getPostgradu(),info.getMajor(), info.getLab(), info.getTerm(), user.getUserId(), user.getPhoneNumber() ); diff --git a/src/test/java/com/postgraduate/support/Resource.java b/src/test/java/com/postgraduate/support/Resource.java index 4be95f54..d531faaf 100644 --- a/src/test/java/com/postgraduate/support/Resource.java +++ b/src/test/java/com/postgraduate/support/Resource.java @@ -26,8 +26,8 @@ public class Resource { private User user = new User(0L, 1L, "mail", "후배", "011", "profile", 0, USER, true, now(), now(), false); private User userOfSenior = new User(0L, 2L, "mail", "선배", "012", "profile", 0, SENIOR, true, now(), now(), false); - private Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2"); - private Profile profile = new Profile("저는요", "한줄소개", "대상", "chatLink", 40); + private Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2", "chatLink", 30); + private Profile profile = new Profile("저는요", "한줄소개", "대상"); private Senior senior = new Senior(0L, userOfSenior, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, info, profile, now(), now()); private SalaryAccount salaryAccount = new SalaryAccount("bank", "1234", "holder"); private Salary salary = new Salary(0L, false, senior, 20000, getSalaryDate(), LocalDateTime.now(), salaryAccount);