From 5dc6804fc8188c61d94c6ea1865041fe096d1f86 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Fri, 9 Aug 2024 15:26:17 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=EB=A1=9C=20PlayListMusic=EC=9D=84=20=EB=B0=9B?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../play/pluv/music/application/MusicExplorer.java | 4 ++-- .../music/application/MusicExplorerComposite.java | 6 +++--- .../java/play/pluv/oauth/google/GoogleConnector.java | 9 +++++---- .../play/pluv/oauth/spotify/SpotifyConnector.java | 11 +++++++---- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/play/pluv/music/application/MusicExplorer.java b/src/main/java/play/pluv/music/application/MusicExplorer.java index a7e0595..5e4ea74 100644 --- a/src/main/java/play/pluv/music/application/MusicExplorer.java +++ b/src/main/java/play/pluv/music/application/MusicExplorer.java @@ -5,11 +5,11 @@ import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.MusicId; import play.pluv.playlist.domain.MusicStreaming; -import play.pluv.music.domain.SourceMusic; +import play.pluv.playlist.domain.PlayListMusic; public interface MusicExplorer { - Optional searchMusic(final String accessToken, final SourceMusic query); + Optional searchMusic(final String accessToken, final PlayListMusic source); void transferMusics( final String accessToken, final List musicIds, final String playlistName diff --git a/src/main/java/play/pluv/music/application/MusicExplorerComposite.java b/src/main/java/play/pluv/music/application/MusicExplorerComposite.java index 01df9de..863738f 100644 --- a/src/main/java/play/pluv/music/application/MusicExplorerComposite.java +++ b/src/main/java/play/pluv/music/application/MusicExplorerComposite.java @@ -11,9 +11,9 @@ import org.springframework.stereotype.Component; import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.MusicId; -import play.pluv.music.domain.SourceMusic; import play.pluv.music.exception.MusicException; import play.pluv.playlist.domain.MusicStreaming; +import play.pluv.playlist.domain.PlayListMusic; @Component public class MusicExplorerComposite { @@ -26,9 +26,9 @@ public MusicExplorerComposite(final Set musicExplorers) { } public Optional searchMusic( - final MusicStreaming musicStreaming, final String accessToken, final SourceMusic query + final MusicStreaming musicStreaming, final String accessToken, final PlayListMusic source ) { - return getClient(musicStreaming).searchMusic(accessToken, query); + return getClient(musicStreaming).searchMusic(accessToken, source); } public void transferMusics( diff --git a/src/main/java/play/pluv/oauth/google/GoogleConnector.java b/src/main/java/play/pluv/oauth/google/GoogleConnector.java index 16a90ae..d9c5288 100644 --- a/src/main/java/play/pluv/oauth/google/GoogleConnector.java +++ b/src/main/java/play/pluv/oauth/google/GoogleConnector.java @@ -13,8 +13,6 @@ import play.pluv.music.application.MusicExplorer; import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.MusicId; -import play.pluv.playlist.domain.MusicStreaming; -import play.pluv.music.domain.SourceMusic; import play.pluv.oauth.application.SocialLoginClient; import play.pluv.oauth.domain.OAuthMemberInfo; import play.pluv.oauth.google.dto.GoogleOAuthResponse; @@ -22,6 +20,7 @@ import play.pluv.oauth.google.dto.YoutubeCreatePlayListRequest; import play.pluv.oauth.google.dto.YoutubeMusicResponses; import play.pluv.playlist.application.PlayListConnector; +import play.pluv.playlist.domain.MusicStreaming; import play.pluv.playlist.domain.PlayList; import play.pluv.playlist.domain.PlayListId; import play.pluv.playlist.domain.PlayListMusic; @@ -73,8 +72,10 @@ public PlayListId createPlayList(final String accessToken, final String title) { } @Override - public Optional searchMusic(final String accessToken, final SourceMusic query) { - final String q = query.getTitle() + String.join(",", query.getArtistNames()); + public Optional searchMusic( + final String accessToken, final PlayListMusic source + ) { + final String q = source.getTitle() + String.join(",", source.getArtistNames()); return googleApiClient.searchMusic(CREATE_AUTH_HEADER.apply(accessToken), q) .toDestinationMusic(); } diff --git a/src/main/java/play/pluv/oauth/spotify/SpotifyConnector.java b/src/main/java/play/pluv/oauth/spotify/SpotifyConnector.java index 0933631..77a6193 100644 --- a/src/main/java/play/pluv/oauth/spotify/SpotifyConnector.java +++ b/src/main/java/play/pluv/oauth/spotify/SpotifyConnector.java @@ -14,7 +14,6 @@ import play.pluv.music.application.MusicExplorer; import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.MusicId; -import play.pluv.music.domain.SourceMusic; import play.pluv.oauth.application.SocialLoginClient; import play.pluv.oauth.domain.OAuthMemberInfo; import play.pluv.oauth.spotify.dto.SpotifyAddMusicRequest; @@ -62,8 +61,10 @@ public MusicStreaming supportedType() { } @Override - public Optional searchMusic(final String accessToken, final SourceMusic query) { - final MultiValueMap param = createRequestParamForSearchMusic(query); + public Optional searchMusic( + final String accessToken, final PlayListMusic source + ) { + final MultiValueMap param = createRequestParamForSearchMusic(source); return spotifyApiClient.searchMusic(CREATE_AUTH_HEADER.apply(accessToken), param) .toMusic(); } @@ -126,7 +127,9 @@ private MultiValueMap createRequestParamForAccessToken(final Str return param; } - private MultiValueMap createRequestParamForSearchMusic(final SourceMusic music) { + private MultiValueMap createRequestParamForSearchMusic( + final PlayListMusic music + ) { final MultiValueMap param = new LinkedMultiValueMap<>(); final String artistName = String.join(",", music.getArtistNames()); From bc83ece579691eef1105d5d94525b45a399e2498 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Fri, 9 Aug 2024 15:26:54 +0900 Subject: [PATCH 2/5] style: optimize import(#73) --- src/main/java/play/pluv/login/application/LoginService.java | 2 +- .../java/play/pluv/oauth/application/SocialLoginClient.java | 2 +- .../play/pluv/oauth/application/SocialLoginClientComposite.java | 2 +- .../java/play/pluv/playlist/exception/PlayListException.java | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/play/pluv/login/application/LoginService.java b/src/main/java/play/pluv/login/application/LoginService.java index c31f908..da7303f 100644 --- a/src/main/java/play/pluv/login/application/LoginService.java +++ b/src/main/java/play/pluv/login/application/LoginService.java @@ -3,9 +3,9 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import play.pluv.member.domain.Member; -import play.pluv.playlist.domain.MusicStreaming; import play.pluv.oauth.application.SocialLoginClientComposite; import play.pluv.oauth.domain.OAuthMemberInfo; +import play.pluv.playlist.domain.MusicStreaming; @Service @RequiredArgsConstructor diff --git a/src/main/java/play/pluv/oauth/application/SocialLoginClient.java b/src/main/java/play/pluv/oauth/application/SocialLoginClient.java index 7588b5f..6585c59 100644 --- a/src/main/java/play/pluv/oauth/application/SocialLoginClient.java +++ b/src/main/java/play/pluv/oauth/application/SocialLoginClient.java @@ -1,7 +1,7 @@ package play.pluv.oauth.application; -import play.pluv.playlist.domain.MusicStreaming; import play.pluv.oauth.domain.OAuthMemberInfo; +import play.pluv.playlist.domain.MusicStreaming; public interface SocialLoginClient { diff --git a/src/main/java/play/pluv/oauth/application/SocialLoginClientComposite.java b/src/main/java/play/pluv/oauth/application/SocialLoginClientComposite.java index 248fdd0..b0ffbd4 100644 --- a/src/main/java/play/pluv/oauth/application/SocialLoginClientComposite.java +++ b/src/main/java/play/pluv/oauth/application/SocialLoginClientComposite.java @@ -8,9 +8,9 @@ import java.util.Optional; import java.util.Set; import org.springframework.stereotype.Component; -import play.pluv.playlist.domain.MusicStreaming; import play.pluv.oauth.domain.OAuthMemberInfo; import play.pluv.oauth.exception.OAuthException; +import play.pluv.playlist.domain.MusicStreaming; @Component public class SocialLoginClientComposite { diff --git a/src/main/java/play/pluv/playlist/exception/PlayListException.java b/src/main/java/play/pluv/playlist/exception/PlayListException.java index 7a198bd..50d196d 100644 --- a/src/main/java/play/pluv/playlist/exception/PlayListException.java +++ b/src/main/java/play/pluv/playlist/exception/PlayListException.java @@ -1,7 +1,6 @@ package play.pluv.playlist.exception; import play.pluv.base.BaseException; -import play.pluv.base.BaseExceptionType; public class PlayListException extends BaseException { From ab24fc81358cfa254518bf1e296fd97456f22945 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Fri, 9 Aug 2024 15:27:58 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20playListMusic=EC=9D=84=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pluv/music/application/MusicService.java | 12 ++++++------ .../application/dto/MusicSearchRequest.java | 9 +++++---- .../application/dto/MusicSearchResponse.java | 17 ++++++++++------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/main/java/play/pluv/music/application/MusicService.java b/src/main/java/play/pluv/music/application/MusicService.java index 5ba3f2a..0be6e7d 100644 --- a/src/main/java/play/pluv/music/application/MusicService.java +++ b/src/main/java/play/pluv/music/application/MusicService.java @@ -11,7 +11,7 @@ import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.MusicId; import play.pluv.playlist.domain.MusicStreaming; -import play.pluv.music.domain.SourceMusic; +import play.pluv.playlist.domain.PlayListMusic; @Service @RequiredArgsConstructor @@ -26,7 +26,7 @@ public List searchMusics( return request.musics().parallelStream() .map(MusicQuery::toDomain) - .map(sourceMusic -> searchMusic(musicStreaming, sourceMusic, accessToken)) + .map(playListMusic -> searchMusic(musicStreaming, playListMusic, accessToken)) .toList(); } @@ -39,14 +39,14 @@ public void transferMusics(final MusicAddRequest request, final MusicStreaming d } private MusicSearchResponse searchMusic( - final MusicStreaming musicStreaming, final SourceMusic sourceMusic, final String accessToken + final MusicStreaming musicStreaming, final PlayListMusic playlistMusic, final String accessToken ) { final Optional result - = musicExplorerComposite.searchMusic(musicStreaming, accessToken, sourceMusic); + = musicExplorerComposite.searchMusic(musicStreaming, accessToken, playlistMusic); return result .map( - destination -> MusicSearchResponse.createFound(sourceMusic, destination) + destination -> MusicSearchResponse.createFound(playlistMusic, destination) ) - .orElseGet(() -> MusicSearchResponse.createNotFound(sourceMusic)); + .orElseGet(() -> MusicSearchResponse.createNotFound(playlistMusic)); } } diff --git a/src/main/java/play/pluv/music/application/dto/MusicSearchRequest.java b/src/main/java/play/pluv/music/application/dto/MusicSearchRequest.java index a084c44..edbefec 100644 --- a/src/main/java/play/pluv/music/application/dto/MusicSearchRequest.java +++ b/src/main/java/play/pluv/music/application/dto/MusicSearchRequest.java @@ -2,24 +2,25 @@ import java.util.Arrays; import java.util.List; -import play.pluv.music.domain.SourceMusic; +import play.pluv.playlist.domain.PlayListMusic; public record MusicSearchRequest( String destinationAccessToken, List musics ) { public record MusicQuery( - String title, String artistName, String isrcCode + String title, String artistName, String isrcCode, String imageUrl ) { - public SourceMusic toDomain() { + public PlayListMusic toDomain() { final List names = Arrays.stream(artistName.split(",")) .map(String::trim) .toList(); - return SourceMusic.builder() + return PlayListMusic.builder() .title(title) .artistNames(names) + .imageUrl(imageUrl) .isrcCode(isrcCode) .build(); } diff --git a/src/main/java/play/pluv/music/application/dto/MusicSearchResponse.java b/src/main/java/play/pluv/music/application/dto/MusicSearchResponse.java index d293a6b..ad91be2 100644 --- a/src/main/java/play/pluv/music/application/dto/MusicSearchResponse.java +++ b/src/main/java/play/pluv/music/application/dto/MusicSearchResponse.java @@ -3,6 +3,7 @@ import lombok.Builder; import play.pluv.music.domain.DestinationMusic; import play.pluv.music.domain.SourceMusic; +import play.pluv.playlist.domain.PlayListMusic; @Builder public record MusicSearchResponse( @@ -13,7 +14,7 @@ public record MusicSearchResponse( ) { public static MusicSearchResponse createFound( - final SourceMusic sourceMusic, final DestinationMusic destinationMusic + final PlayListMusic sourceMusic, final DestinationMusic destinationMusic ) { final SourceMusicResponse sourceMusicResponse = SourceMusicResponse.from(sourceMusic); final DestinationMusicResponse destinationMusicResponse @@ -27,8 +28,8 @@ public static MusicSearchResponse createFound( .build(); } - public static MusicSearchResponse createNotFound(final SourceMusic sourceMusic) { - final SourceMusicResponse response = SourceMusicResponse.from(sourceMusic); + public static MusicSearchResponse createNotFound(final PlayListMusic playListMusic) { + final SourceMusicResponse response = SourceMusicResponse.from(playListMusic); return MusicSearchResponse.builder() .sourceMusic(response) .isEqual(false) @@ -38,13 +39,15 @@ public static MusicSearchResponse createNotFound(final SourceMusic sourceMusic) public record SourceMusicResponse( String title, - String artistName + String artistName, + String imageUrl ) { - public static SourceMusicResponse from(final SourceMusic sourceMusic) { + public static SourceMusicResponse from(final PlayListMusic playListMusic) { return new SourceMusicResponse( - sourceMusic.getTitle(), - String.join(",", sourceMusic.getArtistNames()) + playListMusic.getTitle(), + String.join(",", playListMusic.getArtistNames()), + playListMusic.getImageUrl() ); } } From 51684341076d0c991a858e92d3a6bf3ec19ecbac Mon Sep 17 00:00:00 2001 From: hong-sile Date: Fri, 9 Aug 2024 15:32:35 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20DestinationMusic=20=EB=B9=84?= =?UTF-8?q?=EA=B5=90=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pluv/music/domain/DestinationMusic.java | 15 ++++++++------- .../play/pluv/api/fixture/MusicFixture.java | 18 +++++++++--------- .../music/application/MusicServiceTest.java | 4 ++-- .../music/domain/DestinationMusicTest.java | 17 +++++++++++------ 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/main/java/play/pluv/music/domain/DestinationMusic.java b/src/main/java/play/pluv/music/domain/DestinationMusic.java index bd96bbf..dc5723a 100644 --- a/src/main/java/play/pluv/music/domain/DestinationMusic.java +++ b/src/main/java/play/pluv/music/domain/DestinationMusic.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Getter; import lombok.ToString; +import play.pluv.playlist.domain.PlayListMusic; @ToString @Getter @@ -20,19 +21,19 @@ public class DestinationMusic { //nullable한 값 private final String isrcCode; - public Boolean isSame(final SourceMusic sourceMusic) { + public Boolean isSame(final PlayListMusic playListMusic) { if (isrcCode != null) { - return sourceMusic.getIsrcCode() + return playListMusic.getIsrcCode() .map(isrc -> isrc.equals(isrcCode)) - .orElseGet(() -> compareName(sourceMusic)); + .orElseGet(() -> compareName(playListMusic)); } - return compareName(sourceMusic); + return compareName(playListMusic); } - private Boolean compareName(final SourceMusic sourceMusic) { + private Boolean compareName(final PlayListMusic playListMusic) { final Set set1 = new HashSet<>(artistNames); - final Set set2 = new HashSet<>(sourceMusic.getArtistNames()); + final Set set2 = new HashSet<>(playListMusic.getArtistNames()); - return Objects.equals(sourceMusic.getTitle(), title) && set1.equals(set2); + return Objects.equals(playListMusic.getTitle(), title) && set1.equals(set2); } } diff --git a/src/test/java/play/pluv/api/fixture/MusicFixture.java b/src/test/java/play/pluv/api/fixture/MusicFixture.java index dd6e956..a49c4ef 100644 --- a/src/test/java/play/pluv/api/fixture/MusicFixture.java +++ b/src/test/java/play/pluv/api/fixture/MusicFixture.java @@ -18,15 +18,15 @@ public class MusicFixture { public static List 스포티파이_음악_검색_결과() { return List.of( new MusicSearchResponse( - true, true, new SourceMusicResponse("좋은 날", "아이유"), + true, true, new SourceMusicResponse("좋은 날", "아이유", "imageUrl"), new DestinationMusicResponse("124nkd3fh", "Good Day", "IU", "https://i.scdn.co/image/ab67616d00001e0215cf3110f19687b1a24943d1") ), - new MusicSearchResponse(true, true, new SourceMusicResponse("ㅈㅣㅂ", "hanro"), + new MusicSearchResponse(true, true, new SourceMusicResponse("ㅈㅣㅂ", "hanro", "imageUrl"), new DestinationMusicResponse("uo890df1", "SPOT!", "제니,지코", "https://i.scdn.co/image/ab67616d00001e024930dc9d8cdc7f5f33282538")), new MusicSearchResponse(false, false, - new SourceMusicResponse("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수"), null + new SourceMusicResponse("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수", "imageUrl"), null ) ); } @@ -34,24 +34,24 @@ true, true, new SourceMusicResponse("좋은 날", "아이유"), public static List 유튜브_음악_검색_결과() { return List.of( new MusicSearchResponse( - true, true, new SourceMusicResponse("좋은 날", "아이유"), + true, true, new SourceMusicResponse("좋은 날", "아이유", "imageUrl"), new DestinationMusicResponse("124nkd3fh", "Good Day - MV", "", "https://i.scdn.co/image/ab67616d00001e0215cf3110f19687b1a24943d1") ), - new MusicSearchResponse(true, true, new SourceMusicResponse("ㅈㅣㅂ", "hanro"), + new MusicSearchResponse(true, true, new SourceMusicResponse("ㅈㅣㅂ", "hanro", "imageUrl"), new DestinationMusicResponse("uo890df1", "SPOT! - MV (제니,지코)", "", "https://i.scdn.co/image/ab67616d00001e024930dc9d8cdc7f5f33282538")), new MusicSearchResponse(false, false, - new SourceMusicResponse("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수"), null + new SourceMusicResponse("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수", "imageUrl"), null ) ); } public static MusicSearchRequest 음악_검색_요청() { final List musicQueries = List.of( - new MusicQuery("좋은 날", "아이유", "KRA381001057"), - new MusicQuery("SPOT!", "지코,제니", null), - new MusicQuery("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수", null) + new MusicQuery("좋은 날", "아이유", "KRA381001057", "imageUrl"), + new MusicQuery("SPOT!", "지코,제니", null, "imageUrl"), + new MusicQuery("세상에 존재하지 않는 음악", "세상에 존재하지 않는 가수", null, "imageUrl") ); return new MusicSearchRequest("dfj51lk5", musicQueries); diff --git a/src/test/java/play/pluv/music/application/MusicServiceTest.java b/src/test/java/play/pluv/music/application/MusicServiceTest.java index 5ed6508..8cb4a4a 100644 --- a/src/test/java/play/pluv/music/application/MusicServiceTest.java +++ b/src/test/java/play/pluv/music/application/MusicServiceTest.java @@ -21,13 +21,13 @@ class MusicServiceTest extends ApplicationTest { @Test void 음악을_조회한다() { final MusicSearchRequest request = new MusicSearchRequest("accessToken", - List.of(new MusicQuery("좋은 날", "아이유", "KRA381001057")) + List.of(new MusicQuery("좋은 날", "아이유", "KRA381001057", "imageUrl")) ); final List actual = musicService.searchMusics(SPOTIFY, request); final List expected = List.of( new MusicSearchResponse(true, true, - new SourceMusicResponse("좋은 날", "아이유"), + new SourceMusicResponse("좋은 날", "아이유","imageUrl"), new DestinationMusicResponse("goodDayId", "Good Day", "IU", "href") ) ); diff --git a/src/test/java/play/pluv/music/domain/DestinationMusicTest.java b/src/test/java/play/pluv/music/domain/DestinationMusicTest.java index 3048c15..8d839ea 100644 --- a/src/test/java/play/pluv/music/domain/DestinationMusicTest.java +++ b/src/test/java/play/pluv/music/domain/DestinationMusicTest.java @@ -6,11 +6,12 @@ import java.util.List; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; +import play.pluv.playlist.domain.PlayListMusic; class DestinationMusicTest { @Nested - class SourceMusic과_동일성을_비교한다 { + class PlayListMusic과_동일성을_비교한다 { @Nested @@ -18,7 +19,8 @@ class isrc로_동일성을_비교한다 { @Test void ISRC가_둘다_있는경우() { - final SourceMusic sourceMusic = new SourceMusic("좋은 날", List.of("아이유"), "KRA381001057"); + final PlayListMusic sourceMusic = new PlayListMusic("좋은 날", List.of("아이유"), "KRA381001057", + "imageUrl"); final DestinationMusic destinationMusic = new DestinationMusic( new MusicId(SPOTIFY, "nljewu5"), List.of("IU"), "Good Day", "imageUrl", "KRA381001057" ); @@ -29,8 +31,9 @@ class isrc로_동일성을_비교한다 { } @Test - void SourceMusic의_Isrc가_없는_경우() { - final SourceMusic sourceMusic = new SourceMusic("좋은 날", List.of("아이유"), null); + void PlayListMusic의_Isrc가_없는_경우() { + final PlayListMusic sourceMusic = new PlayListMusic("좋은 날", List.of("아이유"), null, + "imageUrl"); final DestinationMusic destinationMusic = new DestinationMusic( new MusicId(SPOTIFY, "nljewu5"), List.of("IU"), "Good Day", "imageUrl", "KRA381001057" ); @@ -42,7 +45,8 @@ class isrc로_동일성을_비교한다 { @Test void DestinationMusic의_Isrc가_없는_경우() { - final SourceMusic sourceMusic = new SourceMusic("좋은 날", List.of("아이유"), "KRA381001057"); + final PlayListMusic sourceMusic = new PlayListMusic("좋은 날", List.of("아이유"), "KRA381001057", + "imageUrl"); final DestinationMusic destinationMusic = new DestinationMusic( new MusicId(SPOTIFY, "nljewu5"), List.of("IU"), "Good Day", "imageUrl", null ); @@ -55,7 +59,8 @@ class isrc로_동일성을_비교한다 { @Test void Isrc가_없는경우_이름과_가수를_비교한다() { - final SourceMusic sourceMusic = new SourceMusic("SPOT!", List.of("제니", "지코"), null); + final PlayListMusic sourceMusic = new PlayListMusic("SPOT!", List.of("제니", "지코"), null, + "imageUrl"); final DestinationMusic destinationMusic = new DestinationMusic( new MusicId(SPOTIFY, "dfd124"), List.of("지코", "제니"), "SPOT!", "imageUrl", null ); From 8a66d1540b734aaf675590d564bae633a46a90f9 Mon Sep 17 00:00:00 2001 From: hong-sile Date: Fri, 9 Aug 2024 15:32:46 +0900 Subject: [PATCH 5/5] =?UTF-8?q?test:=20musicApiTest=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/play/pluv/api/MusicApiTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/play/pluv/api/MusicApiTest.java b/src/test/java/play/pluv/api/MusicApiTest.java index 3730ce1..8fdf481 100644 --- a/src/test/java/play/pluv/api/MusicApiTest.java +++ b/src/test/java/play/pluv/api/MusicApiTest.java @@ -35,6 +35,7 @@ public class MusicApiTest extends ApiTest { .description("플레이리스트 제공자의 accessToken"), fieldWithPath("musics[].title").type(STRING).description("음악 이름"), fieldWithPath("musics[].artistName").type(STRING).description("가수 이름들"), + fieldWithPath("musics[].imageUrl").type(STRING).description("음악 image url"), fieldWithPath("musics[].isrcCode").type(STRING).description("음악의 isrc코드").optional() ), responseFields( @@ -43,6 +44,7 @@ public class MusicApiTest extends ApiTest { fieldWithPath("data[].isEqual").type(BOOLEAN).description("동일한 음악인지"), fieldWithPath("data[].isFound").type(BOOLEAN).description("찾았는지"), fieldWithPath("data[].sourceMusic.title").type(STRING).description("검색하려는 음악의 이름"), + fieldWithPath("data[].sourceMusic.imageUrl").type(STRING).description("음악 imageUrl"), fieldWithPath("data[].sourceMusic.artistName").type(STRING) .description("검색하려는 음악의 가수 이름"), fieldWithPath("data[].destinationMusic").type(OBJECT).description("조회된 음악 정보")