1919import eatda .controller .cheer .CheerResponse ;
2020import eatda .controller .cheer .CheersInStoreResponse ;
2121import eatda .controller .cheer .CheersResponse ;
22+ import eatda .controller .store .SearchDistrict ;
2223import eatda .document .BaseDocumentTest ;
2324import eatda .document .RestDocsRequest ;
2425import eatda .document .RestDocsResponse ;
2526import eatda .document .Tag ;
2627import eatda .domain .cheer .CheerTagName ;
28+ import eatda .domain .store .StoreCategory ;
2729import eatda .exception .BusinessErrorCode ;
2830import eatda .exception .BusinessException ;
2931import eatda .util .ImageUtils ;
@@ -143,7 +145,12 @@ class GetCheers {
143145 .summary ("최신 응원 검색" )
144146 .queryParameter (
145147 parameterWithName ("page" ).description ("조회 페이지 (기본값 0, 최소 0)" ).optional (),
146- parameterWithName ("size" ).description ("조회 개수 (기본값 5, 최소 1, 최대 50)" ).optional ()
148+ parameterWithName ("size" ).description ("조회 개수 (기본값 5, 최소 1, 최대 50)" ).optional (),
149+ parameterWithName ("category" ).description ("음식점 카테고리 0~1개(기본값: 전체) (ex. KOREAN)" ).optional (),
150+ parameterWithName ("tag" )
151+ .description ("응원 태그 이름 0~N개(기본값: 전체) (ex. INSTAGRAMMABLE,ENERGETIC)" ).optional (),
152+ parameterWithName ("location" )
153+ .description ("음식점 지역 0~N개(기본값: 전체) (ex. GANGNAM,KONDAE)" ).optional ()
147154 );
148155
149156 RestDocsResponse responseDocument = response ()
@@ -164,8 +171,6 @@ class GetCheers {
164171
165172 @ Test
166173 void 음식점_검색_성공 () {
167- int page = 0 ;
168- int size = 2 ;
169174 CheersResponse responses = new CheersResponse (List .of (
170175 new CheerPreviewResponse (2L , "https://example.image" , "농민백암순대 본점" , "강남구" , "선릉구" , "한식" , 2L ,
171176 "너무 맛있어요!" , List .of (CheerTagName .INSTAGRAMMABLE , CheerTagName .CLEAN_RESTROOM ), 5L , "커찬" ),
@@ -181,16 +186,18 @@ class GetCheers {
181186
182187 given (document )
183188 .contentType (ContentType .JSON )
184- .queryParam ("size" , size )
189+ .queryParam ("page" , 0 )
190+ .queryParam ("size" , 2 )
191+ .queryParam ("category" , StoreCategory .KOREAN )
192+ .queryParam ("tag" , CheerTagName .INSTAGRAMMABLE , CheerTagName .CLEAN_RESTROOM )
193+ .queryParam ("location" , SearchDistrict .GANGNAM , SearchDistrict .DAECHI )
185194 .when ().get ("/api/cheer" )
186195 .then ().statusCode (200 );
187196 }
188197
189198 @ EnumSource (value = BusinessErrorCode .class , names = {"PRESIGNED_URL_GENERATION_FAILED" })
190199 @ ParameterizedTest
191200 void 음식점_검색_실패 (BusinessErrorCode errorCode ) {
192- int page = 0 ;
193- int size = 2 ;
194201 doThrow (new BusinessException (errorCode )).when (cheerService ).getCheers (any ());
195202
196203 var document = document ("cheer/get-many" , errorCode )
@@ -200,7 +207,11 @@ class GetCheers {
200207
201208 given (document )
202209 .contentType (ContentType .JSON )
203- .queryParam ("size" , size )
210+ .queryParam ("page" , 0 )
211+ .queryParam ("size" , 2 )
212+ .queryParam ("category" , StoreCategory .KOREAN )
213+ .queryParam ("tag" , CheerTagName .INSTAGRAMMABLE , CheerTagName .CLEAN_RESTROOM )
214+ .queryParam ("location" , SearchDistrict .GANGNAM , SearchDistrict .DAECHI )
204215 .when ().get ("/api/cheer" )
205216 .then ().statusCode (errorCode .getStatus ().value ());
206217 }
0 commit comments