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


Check that not merge profiles with a duplicated planned activity id . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldNotMergeWithDuplicatedPlannedActivityId(final Vertx vertx, final VertxTestContext testContext) {
    final var source = new WeNetUserProfile();
    source.plannedActivities = new ArrayList<>();
    source.plannedActivities.add(new PlannedActivityTest().createModelExample(1));
    source.plannedActivities.add(new PlannedActivityTest().createModelExample(2));
    source.plannedActivities.add(new PlannedActivityTest().createModelExample(3));
    source.plannedActivities.get(0).id = "1";
    source.plannedActivities.get(1).id = "1";
    assertCannotMerge(new WeNetUserProfile(), source, "plannedActivities[1]",
        new WeNetValidateContext("codePrefix", vertx), testContext);
  }
@ Test public void shouldNotMergeWithDuplicatedPlannedActivityId ( final Vertx vertx , final VertxTestContext testContext ) { final var source = new WeNetUserProfile ( ) ; source . plannedActivities = new ArrayList < > ( ) ; source . plannedActivities . add ( new PlannedActivityTest ( ) . createModelExample ( 1 ) ) ; source . plannedActivities . add ( new PlannedActivityTest ( ) . createModelExample ( 2 ) ) ; source . plannedActivities . add ( new PlannedActivityTest ( ) . createModelExample ( 3 ) ) ; source . plannedActivities . get ( 0 ) . id = "1" ; source . plannedActivities . get ( 1 ) . id = "1" ; assertCannotMerge ( new WeNetUserProfile ( ) , source , "plannedActivities[1]" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; }
Check that not merge profiles with a duplicated planned activity id.
Check that not merge profiles with a duplicated planned activity id .