components/src/test/java/eu/internetofus/common/components/task_manager/WeNetTaskManagers.java
/**
   * Wait until the task satisfy a predicate.
   *
   * @param taskId      identifier of the task to get the information.
   * @param checkTask   the function that has to be true to the task is on the state that is waiting.
   * @param vertx       event bus to use.
   * @param testContext context to do the test.
   *
   * @return the future that will return the task that satisfy the predicate.
   */
Wait until the task satisfy a predicate.
@param taskId      identifier of the task to get the information.
@param checkTask   the function that has to be true to the task is on the state that is waiting.
@param vertx       event bus to use.
@param testContext context to do the test.

@return the future that will return the task that satisfy the predicate.
Wait until the task satisfy a predicate . @param taskId identifier of the task to get the information . @param checkTask the function that has to be true to the task is on the state that is waiting . @param vertx event bus to use . @param testContext context to do the test . @return the future that will return the task that satisfy the predicate .
static Future<Task> waitUntilTask(final String taskId, final Predicate<Task> checkTask, final Vertx vertx, final VertxTestContext testContext) {
    return testContext.assertComplete(WeNetTaskManager.createProxy(vertx).retrieveTask(taskId)).compose(task -> {
      if (checkTask.test(task)) {
        return Future.succeededFuture(task);
      } else if (!testContext.completed()) {
        return waitUntilTask(taskId, checkTask, vertx, testContext);
      } else {
        return Future.failedFuture("Test finished");
      }
    });
  }
static Future < Task > waitUntilTask ( final String taskId , final Predicate < Task > checkTask , final Vertx vertx , final VertxTestContext testContext ) { return testContext . assertComplete ( WeNetTaskManager . createProxy ( vertx ) . retrieveTask ( taskId ) ) . compose ( task -> { if ( checkTask . test ( task ) ) { return Future . succeededFuture ( task ) ; } else if ( ! testContext . completed ( ) ) { return waitUntilTask ( taskId , checkTask , vertx , testContext ) ; } else { return Future . failedFuture ( "Test finished" ) ; } } ) ; }
Wait until the task satisfy a predicate.
Wait until the task satisfy a predicate .