@@ -73,6 +73,35 @@ void setUp() {
7373 mentorSlots = mentoringFixture .createMentorSlots (mentor , baseDateTime , 2 , 3 );
7474 }
7575
76+ // ===== 슬롯 조회 =====
77+ @ Test
78+ @ DisplayName ("멘토 슬롯 조회 성공" )
79+ void getMentorSlotSuccess () throws Exception {
80+ MentorSlot mentorSlot = mentorSlots .getFirst ();
81+
82+ ResultActions resultActions = mvc .perform (
83+ get (MENTOR_SLOT_URL + "/" + mentorSlot .getId ())
84+ .cookie (new Cookie (TOKEN , mentorToken ))
85+ )
86+ .andDo (print ());
87+
88+ DateTimeFormatter formatter = DateTimeFormatter .ofPattern ("yyyy-MM-dd'T'HH:mm:ss" );
89+
90+ resultActions
91+ .andExpect (status ().isOk ())
92+ .andExpect (handler ().handlerType (MentorSlotController .class ))
93+ .andExpect (handler ().methodName ("getMentorSlot" ))
94+ .andExpect (jsonPath ("$.resultCode" ).value ("200" ))
95+ .andExpect (jsonPath ("$.msg" ).value ("멘토의 예약 가능 일정을 조회하였습니다." ))
96+ .andExpect (jsonPath ("$.data.mentorSlotId" ).value (mentorSlot .getId ()))
97+ .andExpect (jsonPath ("$.data.mentorId" ).value (mentorSlot .getMentor ().getId ()))
98+ .andExpect (jsonPath ("$.data.mentoringId" ).value (mentoring .getId ()))
99+ .andExpect (jsonPath ("$.data.mentoringTitle" ).value (mentoring .getTitle ()))
100+ .andExpect (jsonPath ("$.data.startDateTime" ).value (mentorSlot .getStartDateTime ().format (formatter )))
101+ .andExpect (jsonPath ("$.data.endDateTime" ).value (mentorSlot .getEndDateTime ().format (formatter )))
102+ .andExpect (jsonPath ("$.data.mentorSlotStatus" ).value (mentorSlot .getStatus ().name ()));
103+ }
104+
76105 // ===== 슬롯 생성 =====
77106
78107 @ Test
@@ -84,7 +113,7 @@ void createMentorSlotSuccess() throws Exception {
84113 ResultActions resultActions = performCreateMentorSlot (mentor .getId (), mentorToken , startDateTime , endDateTime )
85114 .andExpect (status ().isCreated ())
86115 .andExpect (jsonPath ("$.resultCode" ).value ("201" ))
87- .andExpect (jsonPath ("$.msg" ).value ("멘토링 예약 일정을 등록했습니다." ));
116+ .andExpect (jsonPath ("$.msg" ).value ("멘토의 예약 가능 일정을 등록했습니다." ));
88117
89118 MentorSlot mentorSlot = mentorSlotRepository .findTopByOrderByIdDesc ()
90119 .orElseThrow (() -> new ServiceException (MentorSlotErrorCode .NOT_FOUND_MENTOR_SLOT ));
@@ -146,7 +175,7 @@ void updateMentorSlotSuccess() throws Exception {
146175 resultActions
147176 .andExpect (status ().isOk ())
148177 .andExpect (jsonPath ("$.resultCode" ).value ("200" ))
149- .andExpect (jsonPath ("$.msg" ).value ("멘토링 예약 일정이 수정되었습니다." ))
178+ .andExpect (jsonPath ("$.msg" ).value ("멘토의 예약 가능 일정이 수정되었습니다." ))
150179 .andExpect (jsonPath ("$.data.mentorSlotId" ).value (mentorSlot .getId ()))
151180 .andExpect (jsonPath ("$.data.mentorId" ).value (mentorSlot .getMentor ().getId ()))
152181 .andExpect (jsonPath ("$.data.mentoringId" ).value (mentoring .getId ()))
@@ -176,7 +205,7 @@ void updateMentorSlotSuccessReserved() throws Exception {
176205 resultActions
177206 .andExpect (status ().isOk ())
178207 .andExpect (jsonPath ("$.resultCode" ).value ("200" ))
179- .andExpect (jsonPath ("$.msg" ).value ("멘토링 예약 일정이 수정되었습니다." ))
208+ .andExpect (jsonPath ("$.msg" ).value ("멘토의 예약 가능 일정이 수정되었습니다." ))
180209 .andExpect (jsonPath ("$.data.mentorSlotId" ).value (mentorSlot .getId ()))
181210 .andExpect (jsonPath ("$.data.mentorId" ).value (mentorSlot .getMentor ().getId ()))
182211 .andExpect (jsonPath ("$.data.mentoringId" ).value (mentoring .getId ()))
@@ -249,7 +278,7 @@ void deleteMentorSlotSuccess() throws Exception {
249278 .andExpect (handler ().handlerType (MentorSlotController .class ))
250279 .andExpect (handler ().methodName ("deleteMentorSlot" ))
251280 .andExpect (jsonPath ("$.resultCode" ).value ("200" ))
252- .andExpect (jsonPath ("$.msg" ).value ("멘토링 예약 일정이 삭제되었습니다." ));
281+ .andExpect (jsonPath ("$.msg" ).value ("멘토의 예약 가능 일정이 삭제되었습니다." ));
253282
254283 assertThat (afterCnt ).isEqualTo (beforeCnt - 1 );
255284 }
0 commit comments