use of com.github.hakko.musiccabinet.domain.model.music.MBAlbum in project musiccabinet by hakko.
the class MusicBrainzServiceTest method handlesArtistFailureDuringUpdate.
@Test
public void handlesArtistFailureDuringUpdate() throws ApplicationException {
final String revName = reverse(artistName);
submitFile(additionDao, getFile(revName, albumName, trackName));
Mockito.when(service.artistQueryClient.get(revName)).thenThrow(new ApplicationException("Fail", new HttpResponseException(503, "Overloaded")));
service.updateDiscography();
List<MBAlbum> albums = service.getMissingAlbums(artistName, asList(TYPE_EP), null, -1, 0);
Assert.assertEquals(2, albums.size());
assertEquals("Switchblade / Cult of Luna", albums.get(0).getTitle());
assertEquals("Bodies / Recluse", albums.get(1).getTitle());
}
use of com.github.hakko.musiccabinet.domain.model.music.MBAlbum in project musiccabinet by hakko.
the class JdbcMusicBrainzAlbumDaoTest method findsAlbumsMissingFromLibraryWithRecentlyPlayedFilter.
@Test
public void findsAlbumsMissingFromLibraryWithRecentlyPlayedFilter() {
List<MBAlbum> albums = albumDao.getMissingAlbums(null, null, USER, 10, 0);
assertEquals(0, albums.size());
LastFmUser lastFmUser = new LastFmUser(USER);
lastFmDao.createOrUpdateLastFmUser(lastFmUser);
submitFile(additionDao, getFile(artist.getName(), UNKNOWN, UNKNOWN));
Track track = browserDao.getTracks(browserDao.getRandomTrackIds(1)).get(0);
playCountDao.addPlayCount(lastFmUser, track);
albums = albumDao.getMissingAlbums(null, null, USER, 10, 0);
assertEquals(2, albums.size());
}
Aggregations