public class FetchConnectionPageITCase extends RestFbIntegrationTestBase {
@Test
public void checkConnectionPage() {
DefaultFacebookClient client = new DefaultFacebookClient(getAccessToken(), Version.VERSION_2_1);
Connection<Post> connection = client.fetchConnection("/cocacola/feed", Post.class);
assertTrue(connection.getData().size() > 0);
if (connection.hasNext()) {
Connection<Post> connection2 = client.fetchConnectionPage(connection.getNextPageUrl(), Post.class);
assertTrue(connection2.getData().size() > 0);
} else {
fail("Page has no second connection");
}
}