@Test void testSearchArtist() { when(this.spotifyAPICalls.searchInSpotify(ARTIST_NAME1, "artist", 2)).thenReturn(this.artists); List<ArtistEntity> artistEntities = this.search.searchforArtists(ARTIST_NAME1, 2); ArtistEntity artistEntity1 = artistEntities.get(0); ArtistEntity artistEntity2 = artistEntities.get(1); assertThat(artistEntity1.getName(), equalTo(ARTIST_NAME1)); assertThat(artistEntity2.getName(), equalTo(ARTIST_NAME2)); assertThat(artistEntity1.getGenre()[0], equalTo(GENRE1)); assertThat(artistEntity2.getGenre()[0], equalTo(GENRE2)); assertThat(artistEntity1.getUri(), equalTo(ID1)); assertThat(artistEntity2.getUri(), equalTo(ID2)); assertThat(artistEntity1.getImageUrl(), equalTo(IMAGE_URL1)); assertThat(artistEntity2.getImageUrl(), equalTo(IMAGE_URL2)); }
public List<ArtistEntity> searchforArtists(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "artist", limit); if (searchResult != null) { this.artistSearchResults = createArtistData(searchResult.getArtists()); } else { this.artistSearchResults = new ArrayList<>(); } return this.artistSearchResults; }
Search { public List<ArtistEntity> searchforArtists(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "artist", limit); if (searchResult != null) { this.artistSearchResults = createArtistData(searchResult.getArtists()); } else { this.artistSearchResults = new ArrayList<>(); } return this.artistSearchResults; } }
Search { public List<ArtistEntity> searchforArtists(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "artist", limit); if (searchResult != null) { this.artistSearchResults = createArtistData(searchResult.getArtists()); } else { this.artistSearchResults = new ArrayList<>(); } return this.artistSearchResults; }  }
Search { public List<ArtistEntity> searchforArtists(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "artist", limit); if (searchResult != null) { this.artistSearchResults = createArtistData(searchResult.getArtists()); } else { this.artistSearchResults = new ArrayList<>(); } return this.artistSearchResults; }  List<TrackEntity> searchforTracks(String searchItem, int limit); List<PlaylistEntity> searchforPlaylists(String searchItem, int limit); List<AlbumEntity> searchforAlbums(String searchItem, int limit); List<ArtistEntity> searchforArtists(String searchItem, int limit); List<TrackEntity> createTrackData(Paging<Track> searchResult); List<PlaylistEntity> searchOwnPlaylists(int limit); List<PlaylistEntity> searchFeaturedPlaylists(int limit); List<TrackEntity> getTrackSearchResults(); List<AlbumEntity> getAlbumSearchResults(); List<ArtistEntity> getArtistSearchResults(); List<PlaylistEntity> getPlaylistSearchResults(); List<PlaylistEntity> getFeaturedPlaylists(); List<PlaylistEntity> getOwnPlaylists(); }
Search { public List<ArtistEntity> searchforArtists(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "artist", limit); if (searchResult != null) { this.artistSearchResults = createArtistData(searchResult.getArtists()); } else { this.artistSearchResults = new ArrayList<>(); } return this.artistSearchResults; }  List<TrackEntity> searchforTracks(String searchItem, int limit); List<PlaylistEntity> searchforPlaylists(String searchItem, int limit); List<AlbumEntity> searchforAlbums(String searchItem, int limit); List<ArtistEntity> searchforArtists(String searchItem, int limit); List<TrackEntity> createTrackData(Paging<Track> searchResult); List<PlaylistEntity> searchOwnPlaylists(int limit); List<PlaylistEntity> searchFeaturedPlaylists(int limit); List<TrackEntity> getTrackSearchResults(); List<AlbumEntity> getAlbumSearchResults(); List<ArtistEntity> getArtistSearchResults(); List<PlaylistEntity> getPlaylistSearchResults(); List<PlaylistEntity> getFeaturedPlaylists(); List<PlaylistEntity> getOwnPlaylists(); static final int SEARCH_LIMIT; }