components/src/test/java/eu/internetofus/common/components/models/RoutineTest.java
/**
   * Check that merge only the user identifier.
   *
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @see Routine#merge(Routine, WeNetValidateContext)
   */
Check that merge only the user identifier.
@param vertx       event bus to use.
@param testContext test context to use.


Check that merge only the user identifier . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldMergeOnlyUserId(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onSuccess(target -> {
      StoreServices.storeProfileExample(43, vertx, testContext).onSuccess(profile -> {
        final var source = new Routine();
        source.user_id = profile.id;
        assertCanMerge(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, merged -> {
          assertThat(merged).isNotEqualTo(source).isNotEqualTo(target).isNotSameAs(target).isNotSameAs(source);
          target.user_id = source.user_id;
          assertThat(merged).isEqualTo(target);
        });
      });
    });
  }
@ Test public void shouldMergeOnlyUserId ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( target -> { StoreServices . storeProfileExample ( 43 , vertx , testContext ) . onSuccess ( profile -> { final var source = new Routine ( ) ; source . user_id = profile . id ; assertCanMerge ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , merged -> { assertThat ( merged ) . isNotEqualTo ( source ) . isNotEqualTo ( target ) . isNotSameAs ( target ) . isNotSameAs ( source ) ; target . user_id = source . user_id ; assertThat ( merged ) . isEqualTo ( target ) ; } ) ; } ) ; } ) ; }
Check that merge only the user identifier.
Check that merge only the user identifier .