Package com.github.hakko.musiccabinet.ws.lastfm

Examples of com.github.hakko.musiccabinet.ws.lastfm.UserTopArtistsClient


        user2 = lastFmDao.getLastFmUser(USER2);

    LastFmSettingsService lastFmSettingsService = mock(LastFmSettingsService.class);
    when(lastFmSettingsService.getLastFmUsers()).thenReturn(asList(user1, user2));

    UserTopArtistsClient userTopArtistsClient = mock(UserTopArtistsClient.class);
    for (Period period : Period.values()) {
      String fileName = format(TOP_ARTISTS_FILE, period.getDescription());
      when(userTopArtistsClient.getUserTopArtists(user1, period)).thenReturn(
          new WSResponse(new ResourceUtil(fileName, UTF8).getContent()));
      when(userTopArtistsClient.getUserTopArtists(user2, period)).thenReturn(
          new WSResponse(false, 403, "Forbidden"));
    }

    UserTopArtistsService userTopArtistsService = new UserTopArtistsService();
    userTopArtistsService.setLastFmSettingsService(lastFmSettingsService);
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.ws.lastfm.UserTopArtistsClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.