@Test void testSearchAlbum() { when(this.spotifyAPICalls.searchInSpotify(SONG_NAME1, "album", 2)).thenReturn(this.albums); List<AlbumEntity> albumEntities = this.search.searchforAlbums(SONG_NAME1, 2); AlbumEntity albumEntity1 = albumEntities.get(0); AlbumEntity albumEntity2 = albumEntities.get(1); assertThat(albumEntity1.getName(), equalTo(SONG_NAME1)); assertThat(albumEntity2.getName(), equalTo(SONG_NAME2)); assertThat(albumEntity1.getArtists()[0], equalTo(ARTIST_NAME1)); assertThat(albumEntity2.getArtists()[0], equalTo(ARTIST_NAME2)); assertThat(albumEntity1.getUri(), equalTo(ID1)); assertThat(albumEntity2.getUri(), equalTo(ID2)); assertThat(albumEntity1.getImageUrl(), equalTo(IMAGE_URL1)); assertThat(albumEntity2.getImageUrl(), equalTo(IMAGE_URL2)); }
public List<AlbumEntity> searchforAlbums(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "album", limit); if (searchResult != null) { this.albumSearchResults = createAlbumData(searchResult.getAlbums()); } else { this.albumSearchResults = new ArrayList<>(); } return this.albumSearchResults; }
Search { public List<AlbumEntity> searchforAlbums(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "album", limit); if (searchResult != null) { this.albumSearchResults = createAlbumData(searchResult.getAlbums()); } else { this.albumSearchResults = new ArrayList<>(); } return this.albumSearchResults; } }
Search { public List<AlbumEntity> searchforAlbums(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "album", limit); if (searchResult != null) { this.albumSearchResults = createAlbumData(searchResult.getAlbums()); } else { this.albumSearchResults = new ArrayList<>(); } return this.albumSearchResults; }  }
Search { public List<AlbumEntity> searchforAlbums(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "album", limit); if (searchResult != null) { this.albumSearchResults = createAlbumData(searchResult.getAlbums()); } else { this.albumSearchResults = new ArrayList<>(); } return this.albumSearchResults; }  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<AlbumEntity> searchforAlbums(String searchItem, int limit) { SearchResult searchResult = this.spotifyAPICalls.searchInSpotify(searchItem, "album", limit); if (searchResult != null) { this.albumSearchResults = createAlbumData(searchResult.getAlbums()); } else { this.albumSearchResults = new ArrayList<>(); } return this.albumSearchResults; }  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; }