use of com.softartdev.lastfm.scrobble.ScrobbleData in project scroball by peterjosling.
the class LastfmClientTest method updateNowPlaying_returnsResultOnSuccess.
@Test
public void updateNowPlaying_returnsResultOnSuccess() {
String track = "My Track";
String artist = "Some Artist";
when(lastfmApi.updateNowPlaying(any(), any())).thenReturn(scrobbleResult);
when(scrobbleResult.isSuccessful()).thenReturn(true);
client.updateNowPlaying(Track.builder().track(track).artist(artist).build(), callback);
ScrobbleData expectedScrobbleData = new ScrobbleData();
expectedScrobbleData.setTrack(track);
expectedScrobbleData.setArtist(artist);
verify(lastfmApi).updateNowPlaying(refEq(expectedScrobbleData, "timestamp"), refEq(session));
verify(callback).handleMessage(argThat(message -> ((LastfmClient.Result) message.obj).isSuccessful()));
}
Aggregations