components/src/test/java/eu/internetofus/common/components/service/WeNetServiceSimulators.java
/**
   * Wait the App has received the specified call backs.
   *
   * @param appId          identifier of the application to get the call backs.
   * @param checkCallbacks the function that has to be true to finish the get the
   *                       callbacks.
   * @param vertx          event bus to use.
   * @param testContext    context to do the test.
   * @param promise        to inform of the callbacks.
   */
Wait the App has received the specified call backs.
@param appId          identifier of the application to get the call backs.
@param checkCallbacks the function that has to be true to finish the get the
callbacks.
@param vertx          event bus to use.
@param testContext    context to do the test.
@param promise        to inform of the callbacks.
Wait the App has received the specified call backs . @param appId identifier of the application to get the call backs . @param checkCallbacks the function that has to be true to finish the get the callbacks . @param vertx event bus to use . @param testContext context to do the test . @param promise to inform of the callbacks .
static void waitUntilCallbacks(final String appId, final Predicate<JsonArray> checkCallbacks, final Vertx vertx,
      final VertxTestContext testContext, final Promise<JsonArray> promise) {
    WeNetServiceSimulator.createProxy(vertx).retrieveCallbacks(appId, testContext.succeeding(callbacks -> {
      if (checkCallbacks.test(callbacks)) {
        promise.complete(callbacks);
      } else if (!testContext.completed()) {
        waitUntilCallbacks(appId, checkCallbacks, vertx, testContext, promise);
      }
    }));
  }
static void waitUntilCallbacks ( final String appId , final Predicate < JsonArray > checkCallbacks , final Vertx vertx , final VertxTestContext testContext , final Promise < JsonArray > promise ) { WeNetServiceSimulator . createProxy ( vertx ) . retrieveCallbacks ( appId , testContext . succeeding ( callbacks -> { if ( checkCallbacks . test ( callbacks ) ) { promise . complete ( callbacks ) ; } else if ( ! testContext . completed ( ) ) { waitUntilCallbacks ( appId , checkCallbacks , vertx , testContext , promise ) ; } } ) ) ; }
Wait the App has received the specified call backs.
Wait the App has received the specified call backs .