use of com.github.hakko.musiccabinet.dao.LastFmDao in project musiccabinet by hakko.
the class UserRecommendedArtistsClientTest method validateParameters.
@Test
public void validateParameters() throws ApplicationException {
final String method = UserRecommendedArtistsClient.METHOD;
final String lastFmUser = "arnathalon";
final String sessionKey = "sessionkey";
UserRecommendedArtistsClient client = new UserRecommendedArtistsClient() {
@Override
protected WSResponse executeWSRequest(WebserviceInvocation wi, List<NameValuePair> params) throws ApplicationException {
Assert.assertEquals(Calltype.USER_GET_RECOMMENDED_ARTISTS, wi.getCallType());
assertHasParameter(params, PARAM_METHOD, method);
assertHasParameter(params, PARAM_LIMIT, "100");
assertHasParameter(params, PARAM_SK, sessionKey);
return null;
}
};
client.setWebserviceHistoryService(Mockito.mock(WebserviceHistoryService.class));
LastFmDao dao = Mockito.mock(LastFmDao.class);
Mockito.when(dao.getLastFmUser(Mockito.anyString())).thenReturn(new LastFmUser(lastFmUser, sessionKey));
client.setLastFmDao(dao);
client.getUserRecommendedArtists(lastFmUser);
}
Aggregations