use of com.github.hakko.musiccabinet.ws.lastfm.ScrobbleClient in project musiccabinet by hakko.
the class ScrobbleServiceTest method createTestData.
@Before
public void createTestData() throws ApplicationException {
scrobbleService = new ScrobbleService();
UpdateNowPlayingClient nowPlayinglient = mock(UpdateNowPlayingClient.class);
when(nowPlayinglient.updateNowPlaying(Mockito.any(Scrobble.class))).thenReturn(new WSResponse(false, 404, "Not found"));
scrobbleService.setUpdateNowPlayingClient(nowPlayinglient);
ScrobbleClient scrobbleClient = mock(ScrobbleClient.class);
when(scrobbleClient.scrobble(Mockito.any(Scrobble.class))).thenReturn(new WSResponse("<lfm status=\"ok\"></lfm>"));
scrobbleService.setScrobbleClient(scrobbleClient);
PlayCountDao playCountDao = mock(PlayCountDao.class);
scrobbleService.setPlayCountDao(playCountDao);
MetaData metaData1 = new MetaData();
metaData1.setArtist("artist 1");
metaData1.setArtistId(artist1Id);
metaData1.setAlbum("album 1");
metaData1.setAlbumId(album1Id);
track1 = new Track(track1Id, "track 1", metaData1);
track2 = new Track(track2Id, "track 2", metaData1);
user1 = new LastFmUser(username1, sessionKey1);
user2 = new LastFmUser(username2, sessionKey2);
}
Aggregations