Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.example.solidconnection.common.resolver.AuthorizedUser;
import com.example.solidconnection.mentor.dto.CheckMentoringRequest;
import com.example.solidconnection.mentor.dto.CheckedMentoringsResponse;
import com.example.solidconnection.mentor.dto.MatchedMentorResponse;
import com.example.solidconnection.mentor.dto.MentoringApplyRequest;
import com.example.solidconnection.mentor.dto.MentoringApplyResponse;
import com.example.solidconnection.mentor.dto.MentoringForMenteeResponse;
Expand Down Expand Up @@ -38,6 +39,21 @@ public class MentoringForMenteeController {
private final MentoringQueryService mentoringQueryService;
private final MentoringCheckService mentoringCheckService;

@RequireRoleAccess(roles = Role.MENTEE)
@GetMapping("/matched-mentors")
public ResponseEntity<SliceResponse<MatchedMentorResponse>> getMatchedMentors(
@AuthorizedUser long siteUserId,
@PageableDefault
@SortDefaults({
@SortDefault(sort = "confirmedAt", direction = Sort.Direction.DESC),
@SortDefault(sort = "id", direction = Sort.Direction.DESC)
})
Pageable pageable
) {
SliceResponse<MatchedMentorResponse> response = mentoringQueryService.getMatchedMentors(siteUserId, pageable);
return ResponseEntity.ok(response);
}

@RequireRoleAccess(roles = Role.MENTEE)
@PostMapping
public ResponseEntity<MentoringApplyResponse> applyMentoring(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.example.solidconnection.mentor.dto;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

import com.example.solidconnection.mentor.domain.Mentor;
import com.example.solidconnection.siteuser.domain.SiteUser;
import com.example.solidconnection.university.domain.University;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;

public record MatchedMentorResponse(
long id,

@JsonInclude(NON_NULL)
Long roomId,

String nickname,
String profileImageUrl,
String country,
String universityName,
String term,
int menteeCount,
boolean hasBadge,
String introduction,
List<ChannelResponse> channels,
boolean isApplied
) {

public static MatchedMentorResponse of(Mentor mentor, SiteUser mentorUser,
University university, boolean isApplied, Long roomId) {
return new MatchedMentorResponse(
mentor.getId(),
roomId,
mentorUser.getNickname(),
mentorUser.getProfileImageUrl(),
university.getCountry().getKoreanName(),
university.getKoreanName(),
mentor.getTerm(),
mentor.getMenteeCount(),
mentor.isHasBadge(),
mentor.getIntroduction(),
mentor.getChannels().stream().map(ChannelResponse::from).toList(),
isApplied
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ public interface MentoringRepository extends JpaRepository<Mentoring, Long> {
WHERE m.mentorId IN :mentorIds AND m.menteeId = :menteeId
""")
List<Mentoring> findAllByMentorIdInAndMenteeId(@Param("mentorIds") List<Long> mentorIds, @Param("menteeId") long menteeId);

@Query("""
SELECT m FROM Mentoring m
WHERE m.menteeId = :menteeId
AND m.mentorId IN :mentorIds
AND m.verifyStatus = :verifyStatus
""")
List<Mentoring> findApprovedMentoringsByMenteeIdAndMentorIds(@Param("menteeId") long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, @Param("mentorIds") List<Long> mentorIds);
Comment on lines +32 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

빈 mentorIds 전달 시 IN 절 예외 가능성 방어 필요.

  1. JPQL의 IN (:mentorIds)는 빈 리스트 전달 시 데이터베이스/프로바이더에 따라 예외가 발생할 수 있습니다.
  2. 상위 서비스에서 mentors가 비어 있으면 조기 반환하도록 가드 코드를 추가하는 것이 안전합니다.
  3. 본 파일에서 방어하기 어렵다면, 서비스 메서드(getMentorIdToRoomIdMap) 측에 조기 반환을 추가하는 패치를 제안합니다(아래 서비스 파일 코멘트 참고).
🤖 Prompt for AI Agents
In
src/main/java/com/example/solidconnection/mentor/repository/MentoringRepository.java
around lines 32-38, the JPQL IN(:mentorIds) can throw when mentorIds is empty;
instead of changing the repository, update the caller service method
(getMentorIdToRoomIdMap) to check if the mentorIds (or mentors list) is empty
and return an empty result immediately, skipping the repository call; ensure the
service performs a null/empty check on the list and returns
Collections.emptyMap() (or equivalent) so no empty IN clause is ever passed to
the repository.


@Query("SELECT m FROM Mentoring m WHERE m.menteeId = :menteeId AND m.verifyStatus = :verifyStatus")
Slice<Mentoring> findApprovedMentoringsByMenteeId(long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, Pageable pageable);
Comment on lines +40 to +41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

@param 누락으로 인한 런타임 바인딩 실패 가능성을 제거해 주세요.

    1. 쿼리에서 :menteeId를 사용하지만, 메서드 시그니처의 menteeId 파라미터에 @param("menteeId")가 없습니다.
    1. 컴파일 옵션(-parameters) 유무에 따라 런타임 BindException이 발생할 수 있으므로 명시 주입을 권장합니다.

수정 예시:

-    Slice<Mentoring> findApprovedMentoringsByMenteeId(long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, Pageable pageable);
+    Slice<Mentoring> findApprovedMentoringsByMenteeId(@Param("menteeId") long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, Pageable pageable);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Query("SELECT m FROM Mentoring m WHERE m.menteeId = :menteeId AND m.verifyStatus = :verifyStatus")
Slice<Mentoring> findApprovedMentoringsByMenteeId(long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, Pageable pageable);
@Query("SELECT m FROM Mentoring m WHERE m.menteeId = :menteeId AND m.verifyStatus = :verifyStatus")
Slice<Mentoring> findApprovedMentoringsByMenteeId(@Param("menteeId") long menteeId, @Param("verifyStatus") VerifyStatus verifyStatus, Pageable pageable);
🤖 Prompt for AI Agents
In
src/main/java/com/example/solidconnection/mentor/repository/MentoringRepository.java
around lines 40-41, the JPQL uses :menteeId but the method parameter lacks
@Param("menteeId"), which can cause runtime BindException when -parameters is
not enabled; add @Param("menteeId") to the menteeId parameter (and keep the
existing @Param("verifyStatus") for verifyStatus) so both named parameters are
explicitly bound in the repository method signature.

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
import com.example.solidconnection.common.exception.ErrorCode;
import com.example.solidconnection.mentor.domain.Mentor;
import com.example.solidconnection.mentor.domain.Mentoring;
import com.example.solidconnection.mentor.dto.MatchedMentorResponse;
import com.example.solidconnection.mentor.dto.MentoringForMenteeResponse;
import com.example.solidconnection.mentor.dto.MentoringForMentorResponse;
import com.example.solidconnection.mentor.repository.MentorBatchQueryRepository;
import com.example.solidconnection.mentor.repository.MentorRepository;
import com.example.solidconnection.mentor.repository.MentoringRepository;
import com.example.solidconnection.siteuser.domain.SiteUser;
import com.example.solidconnection.siteuser.repository.SiteUserRepository;
import com.example.solidconnection.university.domain.University;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -35,6 +38,59 @@ public class MentoringQueryService {
private final MentorRepository mentorRepository;
private final SiteUserRepository siteUserRepository;
private final ChatRoomRepository chatRoomRepository;
private final MentorBatchQueryRepository mentorBatchQueryRepository;

@Transactional(readOnly = true)
public SliceResponse<MatchedMentorResponse> getMatchedMentors(long siteUserId, Pageable pageable) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filterMatchedMentors 메서드의 filterMatchedMentors 에서 멘티와 매칭된 멘토 목록을 조회하기 위해 mentoring 테이블 접근 한 번, 멘토 목록을 기반으로 채팅방 ID를 가져오는 데 mentoring 테이블 접근 한 번 총 두 번의 테이블 접근이 발생하는 것 같습니다. 아예 mentoring 테이블을 처음에 가져오고, 관련 멘토 정보를 가져오는 방법도 좋을 것 같습니다.

예를 들어

  1. 멘티 ID를 통해 멘토링 전부 조회
  2. 해당 멘토링에 속한 멘토 조회
  3. 이하 동(멘토링 ID에 대해 채팅방 조회 후 응답 만들기)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그게 좋겠네요! 바꿨습니다! 543e4ae

Slice<Mentoring> mentoringSlice = mentoringRepository.findApprovedMentoringsByMenteeId(siteUserId, VerifyStatus.APPROVED, pageable);

List<Long> mentorIds = mentoringSlice.getContent().stream()
.map(Mentoring::getMentorId)
.distinct()
.toList();

List<Mentor> mentors = mentorRepository.findAllById(mentorIds);

List<MatchedMentorResponse> content = buildMatchedMentorsWithBatchQuery(mentors, siteUserId);

return SliceResponse.of(content, mentoringSlice);
}

private List<MatchedMentorResponse> buildMatchedMentorsWithBatchQuery(List<Mentor> mentors, long currentUserId) {
Map<Long, SiteUser> mentorIdToSiteUser = mentorBatchQueryRepository.getMentorIdToSiteUserMap(mentors);
Map<Long, University> mentorIdToUniversity = mentorBatchQueryRepository.getMentorIdToUniversityMap(mentors);
Map<Long, Boolean> mentorIdToIsApplied = mentorBatchQueryRepository.getMentorIdToIsApplied(mentors, currentUserId);

Map<Long, Long> mentorIdToRoomId = getMentorIdToRoomIdMap(mentors, currentUserId);

List<MatchedMentorResponse> matchedMentors = new ArrayList<>();
for (Mentor mentor : mentors) {
SiteUser mentorUser = mentorIdToSiteUser.get(mentor.getId());
University university = mentorIdToUniversity.get(mentor.getId());
boolean isApplied = mentorIdToIsApplied.get(mentor.getId());
Long roomId = mentorIdToRoomId.get(mentor.getId());
MatchedMentorResponse response = MatchedMentorResponse.of(mentor, mentorUser, university, isApplied, roomId);
matchedMentors.add(response);
}
return matchedMentors;
}
Comment on lines +59 to +76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

불리언 언박싱으로 인한 NPE 위험 제거 및 널 안전성 강화가 필요합니다.

    1. isApplied를 Boolean → boolean 언박싱할 때 키 미존재 시 NPE가 납니다.
    • 해결: Boolean.TRUE.equals(...)로 안전 접근하세요.
    1. mentors가 비었을 때는 하위 배치 쿼리를 건너뛰고 조기 반환하는 편이 안전합니다.
    • 해결: 초반 가드 추가.
    1. siteUser/university가 누락될 수 있다면, of(...)가 널 허용인지 확인해 주세요. 널 비허용이라면 기본값/검증 추가가 필요합니다.

적용 패치 예시:

-    private List<MatchedMentorResponse> buildMatchedMentorsWithBatchQuery(List<Mentor> mentors, long currentUserId) {
+    private List<MatchedMentorResponse> buildMatchedMentorsWithBatchQuery(List<Mentor> mentors, long currentUserId) {
+        if (mentors == null || mentors.isEmpty()) {
+            return java.util.Collections.emptyList();
+        }
         Map<Long, SiteUser> mentorIdToSiteUser = mentorBatchQueryRepository.getMentorIdToSiteUserMap(mentors);
         Map<Long, University> mentorIdToUniversity = mentorBatchQueryRepository.getMentorIdToUniversityMap(mentors);
         Map<Long, Boolean> mentorIdToIsApplied = mentorBatchQueryRepository.getMentorIdToIsApplied(mentors, currentUserId);
 
         Map<Long, Long> mentorIdToRoomId = getMentorIdToRoomIdMap(mentors, currentUserId);
 
         List<MatchedMentorResponse> matchedMentors = new ArrayList<>();
         for (Mentor mentor : mentors) {
             SiteUser mentorUser = mentorIdToSiteUser.get(mentor.getId());
             University university = mentorIdToUniversity.get(mentor.getId());
-            boolean isApplied = mentorIdToIsApplied.get(mentor.getId());
+            boolean isApplied = java.lang.Boolean.TRUE.equals(mentorIdToIsApplied.get(mentor.getId()));
             Long roomId = mentorIdToRoomId.get(mentor.getId());
             MatchedMentorResponse response = MatchedMentorResponse.of(mentor, mentorUser, university, isApplied, roomId);
             matchedMentors.add(response);
         }
         return matchedMentors;
     }

추가 요청

    1. Line [70]의 언박싱 NPE를 재현하는 테스트를 하나 추가해 주세요.
    1. mentors가 빈 경우에도 빈 리스트를 반환하는지 확인하는 테스트를 추가해 주세요.

🏁 Script executed:

#!/bin/bash
# Locate MentorBatchQueryRepository interface and verify its methods
rg -n 'interface MentorBatchQueryRepository' -C3 -g '*.java'
rg -n 'class MentorBatchQueryRepository' -C3 -g '*.java'

# Inspect implementations of batch query methods
rg -n 'getMentorIdToSiteUserMap' -C3 -g '*.java'
rg -n 'getMentorIdToUniversityMap' -C3 -g '*.java'
rg -n 'getMentorIdToIsApplied' -C3 -g '*.java'

# Examine MatchedMentorResponse.of(...) signature to check null handling
rg -n 'class MatchedMentorResponse' -C5 -g '*.java'
rg -n 'of\s*\(' -C3 -g 'src/main/java/com/example/solidconnection/mentor/service/MatchedMentorResponse.java'

Length of output: 15164


🏁 Script executed:

#!/bin/bash
# 1) MatchedMentorResponse.java 파일 위치 찾기
find src -type f -name 'MatchedMentorResponse.java'

# 2) of(...) 메서드 선언부와 널 처리 여부 확인
file=$(find src -type f -name 'MatchedMentorResponse.java')
rg -n 'of\s*\(' -C5 "$file"

Length of output: 825


매칭된 멘토 리스트 처리 로직 null 안정성 강화 요청

  1. Boolean 언박싱 NPE 방지
     - mentorIdToIsApplied.get(id)null을 반환할 경우 기본 언박싱(boolean isApplied = …) 시 NPE가 발생합니다.
     - boolean isApplied = Boolean.TRUE.equals(mentorIdToIsApplied.get(mentor.getId())); 와 같이 안전하게 변환해 주세요.

  2. 빈 멘토 리스트 조기 반환 가드 추가
     - mentorsnull이거나 비어있는 경우 하위 배치 쿼리를 건너뛰고 즉시 빈 리스트를 반환하도록 방어 로직을 추가해 주세요.

  3. SiteUser/University null 검증 또는 기본값 제공
     - MatchedMentorResponse.of(mentor, mentorUser, university, …) 내부에서 mentorUser.getNickname() 호출 시 NPE가 발생할 수 있습니다.
     - mentorUser 또는 universitynull인지 확인하고, 필요 시 기본값을 주입하거나 검증 로직을 추가해 주세요.

추가 테스트 작성 요청
 - isAppliednull 맵값을 받을 때도 NPE 없이 false로 처리되는지 검증하는 테스트
 - mentors가 빈 리스트 또는 null일 때 빈 결과 리스트를 반환하는지 검증하는 테스트

🤖 Prompt for AI Agents
In
src/main/java/com/example/solidconnection/mentor/service/MentoringQueryService.java
around lines 59-76, harden buildMatchedMentorsWithBatchQuery: add an early
return if mentors is null or empty to skip batch queries and return
Collections.emptyList(); convert the isApplied mapping lookup to a null-safe
boolean via Boolean.TRUE.equals(mentorIdToIsApplied.get(mentor.getId())); and
null-check mentorUser and university before using them (either inject simple
defaults or validate and pass safe values into MatchedMentorResponse.of to avoid
downstream NPEs, e.g., use a fallback SiteUser/University or pass null-safe
fields). Also add unit tests that verify: (a) null map values for isApplied are
treated as false without NPE, and (b) null or empty mentors input returns an
empty list.


private Map<Long, Long> getMentorIdToRoomIdMap(List<Mentor> mentors, long menteeUserId) {
List<Long> mentorIds = mentors.stream().map(Mentor::getId).toList();
List<Mentoring> approvedMentorings = mentoringRepository.findApprovedMentoringsByMenteeIdAndMentorIds(menteeUserId, VerifyStatus.APPROVED, mentorIds);

List<Long> mentoringIds = approvedMentorings.stream().map(Mentoring::getId).toList();
List<ChatRoom> chatRooms = chatRoomRepository.findAllByMentoringIdIn(mentoringIds);

Map<Long, Long> mentoringIdToRoomId = chatRooms.stream()
.collect(Collectors.toMap(ChatRoom::getMentoringId, ChatRoom::getId));

return approvedMentorings.stream()
.collect(Collectors.toMap(
Mentoring::getMentorId,
mentoring -> mentoringIdToRoomId.get(mentoring.getId())
));
}

@Transactional(readOnly = true)
public SliceResponse<MentoringForMenteeResponse> getMentoringsForMentee(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,33 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.AssertionsForClassTypes.tuple;
import static org.junit.jupiter.api.Assertions.assertAll;

import com.example.solidconnection.chat.domain.ChatRoom;
import com.example.solidconnection.chat.fixture.ChatRoomFixture;
import com.example.solidconnection.common.VerifyStatus;
import com.example.solidconnection.common.dto.SliceResponse;
import com.example.solidconnection.common.exception.CustomException;
import com.example.solidconnection.common.exception.ErrorCode;
import com.example.solidconnection.mentor.domain.Channel;
import com.example.solidconnection.mentor.domain.Mentor;
import com.example.solidconnection.mentor.domain.Mentoring;
import com.example.solidconnection.mentor.dto.ChannelResponse;
import com.example.solidconnection.mentor.dto.MatchedMentorResponse;
import com.example.solidconnection.mentor.dto.MentoringForMenteeResponse;
import com.example.solidconnection.mentor.dto.MentoringForMentorResponse;
import com.example.solidconnection.mentor.fixture.ChannelFixture;
import com.example.solidconnection.mentor.fixture.MentorFixture;
import com.example.solidconnection.mentor.fixture.MentoringFixture;
import com.example.solidconnection.mentor.repository.MentoringRepository;
import com.example.solidconnection.siteuser.domain.SiteUser;
import com.example.solidconnection.siteuser.fixture.SiteUserFixture;
import com.example.solidconnection.support.TestContainerSpringBootTest;
import com.example.solidconnection.university.domain.University;
import com.example.solidconnection.university.fixture.UniversityFixture;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
Expand All @@ -44,6 +54,12 @@ class MentoringQueryServiceTest {
@Autowired
private MentoringFixture mentoringFixture;

@Autowired
private UniversityFixture universityFixture;

@Autowired
private ChannelFixture channelFixture;

@Autowired
private MentoringRepository mentoringRepository;

Expand All @@ -53,6 +69,7 @@ class MentoringQueryServiceTest {
private SiteUser mentorUser1, mentorUser2;
private SiteUser menteeUser1, menteeUser2, menteeUser3;
private Mentor mentor1, mentor2, mentor3;
private University university;
private Pageable pageable;

@BeforeEach
Expand All @@ -63,9 +80,10 @@ void setUp() {
menteeUser1 = siteUserFixture.사용자(1, "mentee1");
menteeUser2 = siteUserFixture.사용자(2, "mentee2");
menteeUser3 = siteUserFixture.사용자(3, "mentee3");
mentor1 = mentorFixture.멘토(mentorUser1.getId(), 1L);
mentor2 = mentorFixture.멘토(mentorUser2.getId(), 1L);
mentor3 = mentorFixture.멘토(mentorUser3.getId(), 1L);
university = universityFixture.괌_대학();
mentor1 = mentorFixture.멘토(mentorUser1.getId(), university.getId());
mentor2 = mentorFixture.멘토(mentorUser2.getId(), university.getId());
mentor3 = mentorFixture.멘토(mentorUser3.getId(), university.getId());
pageable = PageRequest.of(0, 3);
}

Expand Down Expand Up @@ -239,4 +257,71 @@ class 멘티의_멘토링_목록_조회_테스트 {
assertThat(response.content()).isEmpty();
}
}

@Nested
class 멘티의_멘토_목록_조회_테스트 {

private static final int NO_NEXT_PAGE_NUMBER = -1;

private Mentoring mentoring1, mentoring2;
private ChatRoom chatRoom1, chatRoom2;

@BeforeEach
void setUp() {
mentoring1 = mentoringFixture.승인된_멘토링(mentor1.getId(), menteeUser1.getId());
mentoring2 = mentoringFixture.승인된_멘토링(mentor2.getId(), menteeUser1.getId());

chatRoom1 = chatRoomFixture.멘토링_채팅방(mentoring1.getId());
chatRoom2 = chatRoomFixture.멘토링_채팅방(mentoring2.getId());
}

@Test
void 매칭된_멘토의_목록_정보를_조회한다() {
// given
Channel channel1 = channelFixture.채널(1, mentor1);
Channel channel2 = channelFixture.채널(2, mentor2);

// when
SliceResponse<MatchedMentorResponse> response = mentoringQueryService.getMatchedMentors(menteeUser1.getId(), PageRequest.of(0, 10));

// then
Map<Long, MatchedMentorResponse> matchMentorMap = response.content().stream()
.collect(Collectors.toMap(MatchedMentorResponse::id, Function.identity()));
MatchedMentorResponse mentor1Response = matchMentorMap.get(mentor1.getId());
MatchedMentorResponse mentor2Response = matchMentorMap.get(mentor2.getId());
assertAll(
() -> assertThat(mentor1Response.roomId()).isEqualTo(chatRoom1.getId()),
() -> assertThat(mentor1Response.nickname()).isEqualTo(mentorUser1.getNickname()),
() -> assertThat(mentor1Response.universityName()).isEqualTo(university.getKoreanName()),
() -> assertThat(mentor1Response.country()).isEqualTo(university.getCountry().getKoreanName()),
() -> assertThat(mentor1Response.channels()).extracting(ChannelResponse::url)
.containsOnly(channel1.getUrl()),

() -> assertThat(mentor2Response.roomId()).isEqualTo(chatRoom2.getId()),
() -> assertThat(mentor2Response.nickname()).isEqualTo(mentorUser2.getNickname()),
() -> assertThat(mentor2Response.universityName()).isEqualTo(university.getKoreanName()),
() -> assertThat(mentor2Response.country()).isEqualTo(university.getCountry().getKoreanName()),
() -> assertThat(mentor2Response.channels()).extracting(ChannelResponse::url)
.containsOnly(channel2.getUrl())
);
}

@Test
void 다음_페이지_번호를_응답한다() {
// given
SliceResponse<MatchedMentorResponse> response = mentoringQueryService.getMatchedMentors(menteeUser1.getId(), PageRequest.of(0, 1));

// then
assertThat(response.nextPageNumber()).isEqualTo(2);
}

@Test
void 다음_페이지가_없으면_페이지_없음을_의미하는_값을_응답한다() {
// given
SliceResponse<MatchedMentorResponse> response = mentoringQueryService.getMatchedMentors(menteeUser1.getId(), PageRequest.of(0, 10));

// then
assertThat(response.nextPageNumber()).isEqualTo(NO_NEXT_PAGE_NUMBER);
}
}
}
Loading