List of usage examples for io.vertx.core CompositeFuture join
static <T1, T2> CompositeFuture join(Future<T1> f1, Future<T2> f2)
From source file:org.eclipse.hono.tests.IntegrationTestSupport.java
License:Open Source License
/** * Deletes all temporary objects from the Device Registry which * have been created during the last test execution. * /* w w w. j a v a 2 s. c om*/ * @param ctx The vert.x context. */ public void deleteObjects(final TestContext ctx) { devicesToDelete.forEach((tenantId, devices) -> { devices.forEach(deviceId -> { final Async deletion = ctx.async(); CompositeFuture .join(registry.deregisterDevice(tenantId, deviceId), registry.removeAllCredentials(tenantId, deviceId)) .setHandler(ok -> deletion.complete()); deletion.await(); }); }); devicesToDelete.clear(); tenantsToDelete.forEach(tenantId -> { final Async deletion = ctx.async(); registry.removeTenant(tenantId).setHandler(ok -> deletion.complete()); deletion.await(); }); tenantsToDelete.clear(); }