Examples of LastFmUser


Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

    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);
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

      @Override
      protected WebserviceHistoryService getHistoryService() {
        return Mockito.mock(WebserviceHistoryService.class);
      }

    }.getUserTopArtists(new LastFmUser(lastFmUser), period);
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

  @Test
  public void updatesTopArtistsWhenImportIsOnlyAllowedForOneUser() throws Exception {
    PostgreSQLUtil.truncateTables(userTopArtistsDao);

    createArtistInfosAndLocalFiles();
    lastFmDao.createOrUpdateLastFmUser(new LastFmUser(USER1));
    lastFmDao.createOrUpdateLastFmUser(new LastFmUser(USER2));
    LastFmUser user1 = lastFmDao.getLastFmUser(USER1),
        user2 = lastFmDao.getLastFmUser(USER2);

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

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

  @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);
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

    album2 = browserDao.getAlbums((artist2 = artists.get(1)).getId(), true).get(0);
   
    track1 = browserDao.getTracks(album1.getTrackIds()).get(0);
    track2 = browserDao.getTracks(album2.getTrackIds()).get(0);

    lastFmUser1 = new LastFmUser(user1);
    lastFmDao.createOrUpdateLastFmUser(lastFmUser1);
    lastFmUser2 = new LastFmUser(user2);
    lastFmDao.createOrUpdateLastFmUser(lastFmUser2);
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

  @Autowired
  private JdbcLastFmDao dao;
 
  @Test
  public void storesAndRetrievesUser() {
    LastFmUser user = new LastFmUser("username", "sessionkey");
   
    dao.createOrUpdateLastFmUser(user);
    LastFmUser dbUser = dao.getLastFmUser(user.getLastFmUsername());
   
    Assert.assertNotNull(dbUser);
    Assert.assertEquals(user.getLastFmUsername(), dbUser.getLastFmUsername());
    Assert.assertEquals(user.getSessionKey(), dbUser.getSessionKey());
   
    user.setSessionKey("another session key");
    dao.createOrUpdateLastFmUser(user);
    dbUser = dao.getLastFmUser(user.getLastFmUsername());

    Assert.assertNotNull(dbUser);
    Assert.assertEquals(user.getLastFmUsername(), dbUser.getLastFmUsername());
    Assert.assertEquals(user.getSessionKey(), dbUser.getSessionKey());
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

    album1 = albums.get(0);
    album2 = albums.get(1);
    track1 = browserDao.getTracks(album1.getTrackIds()).get(0);
    track2 = browserDao.getTracks(album2.getTrackIds()).get(0);
   
    user1 = new LastFmUser(userName1);
    lastFmDao.createOrUpdateLastFmUser(user1);

    user2 = new LastFmUser(userName2);
    lastFmDao.createOrUpdateLastFmUser(user2);

    artistInfoDao.createArtistInfo(asList(new ArtistInfo(new Artist(artistName1), "img")));
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    AuthSessionParser parser = new AuthSessionParserImpl(
        new ResourceUtil(AUTH_SESSION_FILE).getInputStream());

    LastFmUser lastFmUser = parser.getLastFmUser();

    assertNotNull(lastFmUser);
    assertEquals(NAME, lastFmUser.getLastFmUsername());
    assertEquals(KEY, lastFmUser.getSessionKey());
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

  public UserRecommendedArtistsClient() {
    super(WSConfiguration.AUTHENTICATED_LOGGED);
  }
 
  public WSResponse getUserRecommendedArtists(String lastFmUsername) throws ApplicationException {
    LastFmUser user = lastFmDao.getLastFmUser(lastFmUsername);
   
    WebserviceInvocation webserviceInvocation =
      new WebserviceInvocation(USER_GET_RECOMMENDED_ARTISTS, user);
   
    List<NameValuePair> params = getDefaultParameterList();
    params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
    params.add(new BasicNameValuePair(PARAM_LIMIT, "100"));
    params.add(new BasicNameValuePair(PARAM_SK, user.getSessionKey()));
   
    return executeWSRequest(webserviceInvocation, params);
  }
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.LastFmUser

    String username = rs.getString(1);
    String sessionKey = rs.getString(2);
    String artistName = rs.getString(3);
    String trackName = rs.getString(4);

    return new UserStarredTrack(new LastFmUser(username, sessionKey),
        new Track(artistName, trackName));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.