components/src/test/java/eu/internetofus/common/components/models/WeNetUserProfileTest.java
/**
   * Check fail merge with a bad defined planned activity.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see WeNetUserProfile#merge(WeNetUserProfile, WeNetValidateContext)
   */
Check fail merge with a bad defined planned activity.
@param vertx       event bus to use.
@param testContext context to test.


Check fail merge with a bad defined planned activity . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldFailMergeBadPlannedActivities(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext)
        .onSuccess(created -> assertIsValid(created, new WeNetValidateContext("codePrefix", vertx), testContext,
            () -> StoreServices.storeProfile(created, vertx, testContext).onSuccess(target -> {
              final var source = new WeNetUserProfile();
              source.plannedActivities = new ArrayList<>();
              source.plannedActivities.add(new PlannedActivity());
              source.plannedActivities.get(0).id = target.plannedActivities.get(0).id;
              source.plannedActivities.get(0).attendees = new ArrayList<>();
              source.plannedActivities.get(0).attendees.add("undefined");
              assertCannotMerge(target, source, "plannedActivities[0].attendees[0]",
                  new WeNetValidateContext("codePrefix", vertx), testContext);
            })));
  }
@ Test public void shouldFailMergeBadPlannedActivities ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( created -> assertIsValid ( created , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , ( ) -> StoreServices . storeProfile ( created , vertx , testContext ) . onSuccess ( target -> { final var source = new WeNetUserProfile ( ) ; source . plannedActivities = new ArrayList < > ( ) ; source . plannedActivities . add ( new PlannedActivity ( ) ) ; source . plannedActivities . get ( 0 ) . id = target . plannedActivities . get ( 0 ) . id ; source . plannedActivities . get ( 0 ) . attendees = new ArrayList < > ( ) ; source . plannedActivities . get ( 0 ) . attendees . add ( "undefined" ) ; assertCannotMerge ( target , source , "plannedActivities[0].attendees[0]" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; } ) ) ) ; }
Check fail merge with a bad defined planned activity.
Check fail merge with a bad defined planned activity .