Fix test so that it stops when the next page token is null instead of retrieving an endless supply of items