1111import com .somemore .ControllerTestSupport ;
1212import com .somemore .WithMockCustomUser ;
1313import com .somemore .volunteerapply .dto .condition .VolunteerApplySearchCondition ;
14- import com .somemore .volunteerapply .dto .response .VolunteerApplyDetailResponseDto ;
14+ import com .somemore .volunteerapply .dto .response .VolunteerApplyRecruitInfoResponseDto ;
1515import com .somemore .volunteerapply .dto .response .VolunteerApplyResponseDto ;
1616import com .somemore .volunteerapply .dto .response .VolunteerApplySummaryResponseDto ;
17+ import com .somemore .volunteerapply .dto .response .VolunteerApplyVolunteerInfoResponseDto ;
1718import com .somemore .volunteerapply .usecase .VolunteerApplyQueryFacadeUseCase ;
1819import com .somemore .volunteerapply .usecase .VolunteerApplyQueryUseCase ;
1920import java .util .Collections ;
@@ -105,15 +106,15 @@ void getSummaryByRecruitBoardId() throws Exception {
105106 void getVolunteerApplies () throws Exception {
106107 // given
107108 Long recruitBoardId = 1L ;
108- Page <VolunteerApplyDetailResponseDto > page = new PageImpl <>(Collections .emptyList ());
109+ Page <VolunteerApplyVolunteerInfoResponseDto > page = new PageImpl <>(Collections .emptyList ());
109110
110111 given (volunteerApplyQueryFacadeUseCase .getVolunteerAppliesByRecruitIdAndCenterId (
111112 any (), any (UUID .class ), any (VolunteerApplySearchCondition .class )))
112113 .willReturn (page );
113114
114115 // when
115116 // then
116- mockMvc .perform (get ("/api/volunteer-applies// recruit-board/{id}" , recruitBoardId )
117+ mockMvc .perform (get ("/api/volunteer-applies/recruit-board/{id}" , recruitBoardId )
117118 .param ("attended" , "false" )
118119 .param ("status" , WAITING .toString ())
119120 .accept (APPLICATION_JSON ))
@@ -122,4 +123,27 @@ void getVolunteerApplies() throws Exception {
122123 .andExpect (jsonPath ("$.data" ).exists ())
123124 .andExpect (jsonPath ("$.message" ).value ("지원자 리스트 조회 성공" ));
124125 }
126+
127+ @ Test
128+ @ DisplayName ("특정 봉사자 지원 리스트를 조회 성공 테스트" )
129+ void getVolunteerAppliesByVolunteerId () throws Exception {
130+ // given
131+ UUID volunteerId = UUID .randomUUID ();
132+ Page <VolunteerApplyRecruitInfoResponseDto > page = new PageImpl <>(Collections .emptyList ());
133+
134+ given (volunteerApplyQueryFacadeUseCase .getVolunteerAppliesByVolunteerId (
135+ any (UUID .class ), any (VolunteerApplySearchCondition .class )))
136+ .willReturn (page );
137+
138+ // when
139+ // then
140+ mockMvc .perform (get ("/api/volunteer-applies/volunteer/{id}" , volunteerId .toString ())
141+ .param ("attended" , "false" )
142+ .param ("status" , WAITING .toString ())
143+ .accept (APPLICATION_JSON ))
144+ .andExpect (status ().isOk ())
145+ .andExpect (jsonPath ("$.code" ).value (200 ))
146+ .andExpect (jsonPath ("$.data" ).exists ())
147+ .andExpect (jsonPath ("$.message" ).value ("봉사 지원 리스트 조회 성공" ));
148+ }
125149}
0 commit comments