@Test void testPlayEmptyList() { when(this.search.searchFeaturedPlaylists(5)).thenReturn(new ArrayList<>()); assertThat(this.playerLogic.play(), equalTo(null)); }
public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; }
PlayerLogic { public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; } }
PlayerLogic { public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; }  }
PlayerLogic { public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; }  URI firstTimeInit(String clientID, String clientSecret); URI firstTimeInit(); void inputAuthCode(String authCode); PlaylistEntity play(); PlaylistEntity playPlaylist(int playlistNumber, SearchTypes type); TrackEntity playTrack(int trackNumber); AlbumEntity playAlbum(int albumNumber); ArtistEntity playArtist(int artistNumber); boolean resume(); boolean pause(); boolean skip(); boolean back(); TrackEntity getCurrentSong(); int setVolume(String volumeString); int setVolume(int volume); int getVolume(); }
PlayerLogic { public PlaylistEntity play() { List<PlaylistEntity> playLists; playLists = this.search.searchFeaturedPlaylists(5); if (!playLists.isEmpty()) { if (this.suppressed) { this.collectionUriToPlay = playLists.get(0).getUri(); this.postSuppressionAction = PostSuppressionAction.PLAY_COLLECTION; } else { this.spotifyAPICalls.playListFromUri(playLists.get(0).getUri()); } return playLists.get(0); } this.logger.warn("no featured playlist found"); return null; }  URI firstTimeInit(String clientID, String clientSecret); URI firstTimeInit(); void inputAuthCode(String authCode); PlaylistEntity play(); PlaylistEntity playPlaylist(int playlistNumber, SearchTypes type); TrackEntity playTrack(int trackNumber); AlbumEntity playAlbum(int albumNumber); ArtistEntity playArtist(int artistNumber); boolean resume(); boolean pause(); boolean skip(); boolean back(); TrackEntity getCurrentSong(); int setVolume(String volumeString); int setVolume(int volume); int getVolume();  }