components/src/test/java/eu/internetofus/common/components/models/WeNetUserProfileTest.java
/**
   * Create an example model that has the specified index.
   *
   * @param index       to use in the example.
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @return the created profile.
   */
Create an example model that has the specified index.
@param index       to use in the example.
@param vertx       event bus to use.
@param testContext test context to use.

@return the created profile.
Create an example model that has the specified index . @param index to use in the example . @param vertx event bus to use . @param testContext test context to use . @return the created profile .
public Future<WeNetUserProfile> createModelExample(final int index, final Vertx vertx,
      final VertxTestContext testContext) {
    return testContext
        .assertComplete(WeNetProfileManager.createProxy(vertx).createProfile(new WeNetUserProfile()).compose(stored1 ->
        WeNetProfileManager.createProxy(vertx).createProfile(new WeNetUserProfile()).map(stored2 -> {
          final var profile = this.createModelExample(index);
          final var activity = new PlannedActivityTest().createModelExample(index);
          activity.attendees = new ArrayList<>();
          activity.attendees.add(stored1.id);
          activity.attendees.add(stored2.id);
          profile.plannedActivities.add(activity);
          profile.personalBehaviors = new ArrayList<>();
          profile.personalBehaviors.add(new RoutineTest().createModelExample(index));
          profile.personalBehaviors.get(0).user_id = stored2.id;
          return profile;
        })));
  }
public Future < WeNetUserProfile > createModelExample ( final int index , final Vertx vertx , final VertxTestContext testContext ) { return testContext . assertComplete ( WeNetProfileManager . createProxy ( vertx ) . createProfile ( new WeNetUserProfile ( ) ) . compose ( stored1 -> WeNetProfileManager . createProxy ( vertx ) . createProfile ( new WeNetUserProfile ( ) ) . map ( stored2 -> { final var profile = this . createModelExample ( index ) ; final var activity = new PlannedActivityTest ( ) . createModelExample ( index ) ; activity . attendees = new ArrayList < > ( ) ; activity . attendees . add ( stored1 . id ) ; activity . attendees . add ( stored2 . id ) ; profile . plannedActivities . add ( activity ) ; profile . personalBehaviors = new ArrayList < > ( ) ; profile . personalBehaviors . add ( new RoutineTest ( ) . createModelExample ( index ) ) ; profile . personalBehaviors . get ( 0 ) . user_id = stored2 . id ; return profile ; } ) ) ) ; }
Create an example model that has the specified index.
Create an example model that has the specified index .