gatj98 commented on this pull request.
> @@ -52,12 +51,12 @@ public void testListDatacentersWithPagination() throws
> Exception {
server.enqueue(jsonResponse("/datacenters-page2.json"));
Iterable<Datacenter> datacenters =
api.getInfrastructureApi().listDatacenters().concat();
- assertEquals(server.getRequestCount(), 2);
- assertEquals(size(datacenters), 2);
+ assertEquals(server.getRequestCount(), 2); // 1 for account, 1 for page 1
+ assertEquals(size(datacenters), 2); // Causes all pages to be requested
assertEquals(server.getRequestCount(), 3); // 1 for account details, 2
pages
Am not 100% happy with this as I feel it needs code comments to explain what
the test is doing.
Maybe a helper method of the form
"consumeIterableAndAssertPagesRequested(Iterable iterable, int
expectedExtraPagesRequested)" would be better?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/377#pullrequestreview-29177096