@@ -42,14 +42,14 @@ public class ComposerQueryControllerTest extends ControllerTestSupport {
4242 void 작곡가_목록을_조회한다 () throws Exception {
4343 // given
4444 List <ComposerResponseDto > response = List .of (
45- new ComposerResponseDto (1L , "코렐리" , "Arcangelo Corelli" , "Arcangelo Corelli" , "이탈리아" , "MALE" , (short ) 1653 , (short ) 1713 , "“ 바이올린의 따스한 숨결이 서로를 감싸는 밤” " , true ),
46- new ComposerResponseDto (2L , "비탈리" , "Tomaso Antonio Vitali" , "Tomaso Antonio Vitali" , "이탈리아" , "MALE" , (short ) 1663 , (short ) 1745 , "“ 서정이 흐르는 현의 떨림, 조용히 마음을 울리는 음악” " , false ),
47- new ComposerResponseDto (3L , "A. 스카를라티" , "Alessandro Scarlatti" , "Alessandro Scarlatti" , "이탈리아" , "MALE" , (short ) 1660 , (short ) 1725 , "“ 수많은 이야기 속에 피어나는 이탈리아의 정열” " , true ),
48- new ComposerResponseDto (4L , "D. 스카를라티" , "Domenico Scarlatti" , "Domenico Scarlatti" , "이탈리아" , "MALE" , (short ) 1685 , (short ) 1757 , "“ 하늘을 나는 건반 위 상상, 자유로운 영혼의 소나타” " , false ),
49- new ComposerResponseDto (5L , "비발디" , "Antonio Vivaldi" , "Antonio Vivaldi" , "이탈리아" , "MALE" , (short ) 1678 , (short ) 1741 , "“ 빨간 머리의 계절처럼 쏟아지는 생명과 빛” " , true ),
50- new ComposerResponseDto (6L , "타르티니" , "Giuseppe Tartini" , "Giuseppe Tartini" , "이탈리아" , "MALE" , (short ) 1692 , (short ) 1770 , "“ 악마도 울릴 만큼 깊은 꿈결, 신비로운 선율의 마법” " , false ),
51- new ComposerResponseDto (7L , "파헬벨" , "Johann Pachelbel" , "Johann Pachelbel" , "독일" , "MALE" , (short ) 1653 , (short ) 1706 , "“ 시간 너머의 따뜻한 안식, 평화로운 하루의 시작” " , true ),
52- new ComposerResponseDto (8L , "마테존" , "Johann Mattheson" , "Johann Mattheson" , "독일" , "MALE" , (short ) 1681 , (short ) 1764 , "“ 생각과 음악이 나란히 걷는 길, 새로움을 질문하는 순간” " , false )
45+ new ComposerResponseDto (1L , "코렐리" , "Arcangelo Corelli" , "Arcangelo Corelli" , "이탈리아" , "MALE" , (short ) 1653 , (short ) 1713 , "바이올린의 따스한 숨결이 서로를 감싸는 밤" , true , 3L , Instant . parse ( "2024-03-01T12:00:00Z" ) ),
46+ new ComposerResponseDto (2L , "비탈리" , "Tomaso Antonio Vitali" , "Tomaso Antonio Vitali" , "이탈리아" , "MALE" , (short ) 1663 , (short ) 1745 , "서정이 흐르는 현의 떨림, 조용히 마음을 울리는 음악" , false , 0L , null ),
47+ new ComposerResponseDto (3L , "A. 스카를라티" , "Alessandro Scarlatti" , "Alessandro Scarlatti" , "이탈리아" , "MALE" , (short ) 1660 , (short ) 1725 , "수많은 이야기 속에 피어나는 이탈리아의 정열" , true , 1L , Instant . parse ( "2024-02-15T09:00:00Z" ) ),
48+ new ComposerResponseDto (4L , "D. 스카를라티" , "Domenico Scarlatti" , "Domenico Scarlatti" , "이탈리아" , "MALE" , (short ) 1685 , (short ) 1757 , "하늘을 나는 건반 위 상상, 자유로운 영혼의 소나타" , false , 0L , null ),
49+ new ComposerResponseDto (5L , "비발디" , "Antonio Vivaldi" , "Antonio Vivaldi" , "이탈리아" , "MALE" , (short ) 1678 , (short ) 1741 , "빨간 머리의 계절처럼 쏟아지는 생명과 빛" , true , 5L , Instant . parse ( "2024-03-10T18:30:00Z" ) ),
50+ new ComposerResponseDto (6L , "타르티니" , "Giuseppe Tartini" , "Giuseppe Tartini" , "이탈리아" , "MALE" , (short ) 1692 , (short ) 1770 , "악마도 울릴 만큼 깊은 꿈결, 신비로운 선율의 마법" , false , 2L , Instant . parse ( "2024-01-20T14:00:00Z" ) ),
51+ new ComposerResponseDto (7L , "파헬벨" , "Johann Pachelbel" , "Johann Pachelbel" , "독일" , "MALE" , (short ) 1653 , (short ) 1706 , "시간 너머의 따뜻한 안식, 평화로운 하루의 시작" , true , 0L , null ),
52+ new ComposerResponseDto (8L , "마테존" , "Johann Mattheson" , "Johann Mattheson" , "독일" , "MALE" , (short ) 1681 , (short ) 1764 , "생각과 음악이 나란히 걷는 길, 새로움을 질문하는 순간" , false , 4L , Instant . parse ( "2024-03-05T10:00:00Z" ) )
5353 );
5454 when (composerQueryService .getAllComposers (any (), any (), any ())).thenReturn (response );
5555
@@ -81,7 +81,9 @@ public class ComposerQueryControllerTest extends ControllerTestSupport {
8181 fieldWithPath ("[].birthYear" ).type (JsonFieldType .NUMBER ).description ("작곡가 출생년도" ).optional (),
8282 fieldWithPath ("[].deathYear" ).type (JsonFieldType .NUMBER ).description ("작곡가 사망년도" ).optional (),
8383 fieldWithPath ("[].bio" ).type (JsonFieldType .STRING ).description ("작곡가 소개" ).optional (),
84- fieldWithPath ("[].isLiked" ).type (JsonFieldType .BOOLEAN ).description ("현재 유저의 좋아요 여부 (비로그인 시 false)" )
84+ fieldWithPath ("[].isLiked" ).type (JsonFieldType .BOOLEAN ).description ("현재 유저의 좋아요 여부 (비로그인 시 false)" ),
85+ fieldWithPath ("[].storyPostCount" ).type (JsonFieldType .NUMBER ).description ("스토리 게시글 수" ),
86+ fieldWithPath ("[].lastStoryPostAt" ).type (JsonFieldType .STRING ).description ("가장 최근 스토리 게시글 작성 시각 (게시글 없으면 null)" ).optional ()
8587 )
8688 .build ()
8789 )
@@ -94,7 +96,8 @@ public class ComposerQueryControllerTest extends ControllerTestSupport {
9496 Long composerId = 1L ;
9597 ComposerResponseDto composerDto = new ComposerResponseDto (
9698 1L , "코렐리" , "Arcangelo Corelli" , "Arcangelo Corelli" , "이탈리아" , "MALE" ,
97- (short ) 1653 , (short ) 1713 , "“바이올린의 따스한 숨결이 서로를 감싸는 밤”" , true
99+ (short ) 1653 , (short ) 1713 , "바이올린의 따스한 숨결이 서로를 감싸는 밤" , true ,
100+ 3L , Instant .parse ("2024-01-15T10:30:00Z" )
98101 );
99102
100103 PostResponseDto post1 = new PostResponseDto (
@@ -176,6 +179,8 @@ public class ComposerQueryControllerTest extends ControllerTestSupport {
176179 fieldWithPath ("composer.deathYear" ).type (JsonFieldType .NUMBER ).description ("작곡가 사망년도" ).optional (),
177180 fieldWithPath ("composer.bio" ).type (JsonFieldType .STRING ).description ("작곡가 소개" ).optional (),
178181 fieldWithPath ("composer.isLiked" ).type (JsonFieldType .BOOLEAN ).description ("현재 유저의 좋아요 여부 (비로그인 시 false)" ),
182+ fieldWithPath ("composer.storyPostCount" ).type (JsonFieldType .NUMBER ).description ("스토리 게시글 수" ),
183+ fieldWithPath ("composer.lastStoryPostAt" ).type (JsonFieldType .STRING ).description ("가장 최근 스토리 게시글 작성 시각 (게시글 없으면 null)" ).optional (),
179184 fieldWithPath ("posts" ).type (JsonFieldType .OBJECT ).description ("포스트 목록 페이징 정보" ),
180185 fieldWithPath ("posts.content" ).type (JsonFieldType .ARRAY ).description ("포스트 목록" ),
181186 fieldWithPath ("posts.content[].id" ).type (JsonFieldType .NUMBER ).description ("포스트 ID" ),
0 commit comments