use of com.github.hakko.musiccabinet.service.lastfm.WebserviceHistoryService in project musiccabinet by hakko.
the class UserTopArtistsClientTest method validateParameters.
@Test
public void validateParameters() throws ApplicationException {
final String method = UserTopArtistsClient.METHOD;
final String lastFmUser = "arnathalon";
final Period period = Period.OVERALL;
new UserTopArtistsClient() {
@Override
protected WSResponse executeWSRequest(WebserviceInvocation wi, List<NameValuePair> params) throws ApplicationException {
Assert.assertEquals(Calltype.USER_GET_TOP_ARTISTS, wi.getCallType());
Assert.assertEquals(lastFmUser, wi.getUser().getLastFmUsername());
assertHasParameter(params, PARAM_METHOD, method);
assertHasParameter(params, PARAM_USER, lastFmUser);
assertHasParameter(params, PARAM_PERIOD, period.getDescription());
return null;
}
@Override
protected WebserviceHistoryService getHistoryService() {
return Mockito.mock(WebserviceHistoryService.class);
}
}.getUserTopArtists(new LastFmUser(lastFmUser), period);
}
Aggregations