11package com .example .solidconnection .mentor .service ;
22
33import static org .assertj .core .api .Assertions .assertThat ;
4+ import static org .assertj .core .api .Assertions .assertThatCode ;
45import static org .assertj .core .api .AssertionsForClassTypes .tuple ;
56
67import com .example .solidconnection .common .VerifyStatus ;
78import com .example .solidconnection .common .dto .SliceResponse ;
9+ import com .example .solidconnection .common .exception .CustomException ;
10+ import com .example .solidconnection .common .exception .ErrorCode ;
811import com .example .solidconnection .mentor .domain .Mentor ;
912import com .example .solidconnection .mentor .domain .Mentoring ;
1013import com .example .solidconnection .mentor .dto .MentoringForMenteeResponse ;
@@ -105,6 +108,7 @@ class 멘토의_멘토링_목록_조회_테스트 {
105108 // given
106109 Mentoring mentoring1 = mentoringFixture .대기중_멘토링 (mentor1 .getId (), menteeUser1 .getId ());
107110 Mentoring mentoring2 = mentoringFixture .승인된_멘토링 (mentor1 .getId (), menteeUser2 .getId ());
111+
108112 // when
109113 SliceResponse <MentoringForMentorResponse > response = mentoringQueryService .getMentoringsForMentor (mentorUser1 .getId (), pageable );
110114
@@ -130,6 +134,17 @@ class 멘토의_멘토링_목록_조회_테스트 {
130134 @ Nested
131135 class 멘티의_멘토링_목록_조회_테스트 {
132136
137+ @ Test
138+ void 거절된_멘토링_목록을_조회하면_예외가_발생한다 () {
139+ // given
140+ mentoringFixture .거절된_멘토링 (mentor1 .getId (), menteeUser1 .getId ());
141+
142+ // when & then
143+ assertThatCode (() -> mentoringQueryService .getMentoringsForMentee (menteeUser1 .getId (), VerifyStatus .REJECTED , pageable ))
144+ .isInstanceOf (CustomException .class )
145+ .hasMessageContaining (ErrorCode .UNAUTHORIZED_MENTORING .getMessage ());
146+ }
147+
133148 @ Test
134149 void 승인된_멘토링_목록을_조회한다 () {
135150 // given
0 commit comments