@Test(dependsOnMethods = {"setMetadata"}) public void listManyPagesOfQueuesWithDetails() throws Exception { for (String zoneId : zones) { QueueApi queueApi = api.getQueueApiForZoneAndClient(zoneId, CLIENT_ID); List<Queue> queues = queueApi.list(true).concat().toList(); assertEquals(queues.size(), 12); for (Queue queue : queues) { assertNotNull(queue.getName()); assertTrue(queue.getMetadata().isPresent()); if (queue.getName().equals("jclouds-test-1")) { assertEquals(queue.getMetadata().get().get("key1"), "value1"); } else { assertTrue(queue.getMetadata().get().isEmpty()); } } } }
@Test(dependsOnMethods = {"createMore"}) public void listManyPagesOfQueues() throws Exception { for (String zoneId : zones) { QueueApi queueApi = api.getQueueApiForZoneAndClient(zoneId, CLIENT_ID); List<Queue> queues = queueApi.list(false).concat().toList(); assertEquals(queues.size(), 12); for (Queue queue : queues) { assertNotNull(queue.getName()); assertFalse(queue.getMetadata().isPresent()); } } }
@Test(dependsOnMethods = {"listManyPagesOfQueues"}) public void listManyPagesOfQueuesManually() throws Exception { for (String zoneId : zones) { QueueApi queueApi = api.getQueueApiForZoneAndClient(zoneId, CLIENT_ID); Queues queues = queueApi.list(limit(6)); while (queues.nextMarker().isPresent()) { assertEquals(queues.size(), 6); for (Queue queue : queues) { assertNotNull(queue.getName()); assertFalse(queue.getMetadata().isPresent()); } queues = queueApi.list(queues.nextListQueuesOptions()); } } }