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


Check that merge only the weight . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldMergeOnlyWeight(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onSuccess(target -> {
      final var source = new SocialNetworkRelationship();
      var weight = 0D;
      do {
        weight = Math.random();
      } while (weight == target.weight);
      source.weight = weight;
      assertCanMerge(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, merged -> {
        assertThat(merged).isNotEqualTo(source).isNotEqualTo(target).isNotSameAs(target).isNotSameAs(source);
        target.weight = source.weight;
        assertThat(merged).isEqualTo(target);
      });
    });
  }
@ Test public void shouldMergeOnlyWeight ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( target -> { final var source = new SocialNetworkRelationship ( ) ; var weight = 0D ; do { weight = Math . random ( ) ; } while ( weight == target . weight ) ; source . weight = weight ; assertCanMerge ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , merged -> { assertThat ( merged ) . isNotEqualTo ( source ) . isNotEqualTo ( target ) . isNotSameAs ( target ) . isNotSameAs ( source ) ; target . weight = source . weight ; assertThat ( merged ) . isEqualTo ( target ) ; } ) ; } ) ; }
Check that merge only the weight.
Check that merge only the weight .