components/src/test/java/eu/internetofus/common/components/service/AppTest.java
/**
   * Add some users into an application.
   *
   * @param appId       identifier of the application to add the users.
   * @param max         the number of users to add to the application.
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @return the future application.
   */
Add some users into an application.
@param appId       identifier of the application to add the users.
@param max         the number of users to add to the application.
@param vertx       event bus to use.
@param testContext test context to use.

@return the future application.
Add some users into an application . @param appId identifier of the application to add the users . @param max the number of users to add to the application . @param vertx event bus to use . @param testContext test context to use . @return the future application .
public static Future<JsonArray> addUsersToApp(final String appId, final int max, final Vertx vertx,
      final VertxTestContext testContext) {
    Future<JsonArray> future = Future.succeededFuture(new JsonArray());
    for (var i = 0; i < max; i++) {
      future = future.compose(users -> StoreServices.storeProfileExample(1, vertx, testContext).map(profile -> {
        users.add(profile.id);
        return users;
      }));
    }
    return testContext
        .assertComplete(future.compose(users -> WeNetServiceSimulator.createProxy(vertx).addUsers(appId, users)));
  }
public static Future < JsonArray > addUsersToApp ( final String appId , final int max , final Vertx vertx , final VertxTestContext testContext ) { Future < JsonArray > future = Future . succeededFuture ( new JsonArray ( ) ) ; for ( var i = 0 ; i < max ; i ++ ) { future = future . compose ( users -> StoreServices . storeProfileExample ( 1 , vertx , testContext ) . map ( profile -> { users . add ( profile . id ) ; return users ; } ) ) ; } return testContext . assertComplete ( future . compose ( users -> WeNetServiceSimulator . createProxy ( vertx ) . addUsers ( appId , users ) ) ) ; }
Add some users into an application.
Add some users into an application .