use of de.danoeh.antennapod.model.feed.FeedPreferences in project AntennaPod by AntennaPod.
the class PlaybackVolumeUpdaterTest method mockFeedMedia.
private FeedMedia mockFeedMedia() {
FeedMedia feedMedia = mock(FeedMedia.class);
FeedItem feedItem = mock(FeedItem.class);
Feed feed = mock(Feed.class);
FeedPreferences feedPreferences = mock(FeedPreferences.class);
when(feedMedia.getItem()).thenReturn(feedItem);
when(feedItem.getFeed()).thenReturn(feed);
when(feed.getId()).thenReturn(FEED_ID);
when(feed.getPreferences()).thenReturn(feedPreferences);
return feedMedia;
}
use of de.danoeh.antennapod.model.feed.FeedPreferences in project AntennaPod by AntennaPod.
the class PlaybackVolumeUpdaterTest method updatesPreferencesForLoadedFeedMediaIfPlayerStatusIsInitializing.
@Test
public void updatesPreferencesForLoadedFeedMediaIfPlayerStatusIsInitializing() {
PlaybackVolumeUpdater playbackVolumeUpdater = new PlaybackVolumeUpdater();
when(mediaPlayer.getPlayerStatus()).thenReturn(PlayerStatus.INITIALIZING);
FeedMedia feedMedia = mockFeedMedia();
when(mediaPlayer.getPlayable()).thenReturn(feedMedia);
FeedPreferences feedPreferences = feedMedia.getItem().getFeed().getPreferences();
playbackVolumeUpdater.updateVolumeIfNecessary(mediaPlayer, FEED_ID, VolumeAdaptionSetting.LIGHT_REDUCTION);
verify(feedPreferences, times(1)).setVolumeAdaptionSetting(VolumeAdaptionSetting.LIGHT_REDUCTION);
verify(mediaPlayer, never()).pause(anyBoolean(), anyBoolean());
verify(mediaPlayer, never()).resume();
}
Aggregations