Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save komiya-atsushi/4143064 to your computer and use it in GitHub Desktop.
Save komiya-atsushi/4143064 to your computer and use it in GitHub Desktop.
Paging#count() of ListsResources#getUserListStatuses() doesn't work.
/*
* TFJ-726 reproducing code.
*/
import org.junit.Assert;
import org.junit.Test;
import twitter4j.*;
public class GetUserListStatusesPagingCountTest {
@Test
public void pagingCountDosentWork() throws TwitterException {
final int COUNT = 10;
Twitter twitter = TwitterFactory.getSingleton();
Paging paging = new Paging();
paging.count(COUNT);
ResponseList<Status> res =
twitter
.getUserListStatuses(633835271L, "tokyowebmining-23", paging);
int actual = res.size();
Assert
.assertTrue(
String
.format(
"Twitter#getUserListStatuses(userId, slug, new Paging().count(%d)).size() must be equal or less than %d, but %d",
COUNT,
COUNT,
actual),
actual <= COUNT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment