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


Check that update only the target identifier . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldUpdateOnlyTargetId(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onSuccess(target -> {
      StoreServices.storeProfile(new WeNetUserProfile(), vertx, testContext).onSuccess(profile -> {
        final var newModel = Model.fromBuffer(target.toBuffer(), SocialNetworkRelationship.class);
        newModel.targetId = profile.id;
        assertCanUpdate(target, newModel, new WeNetValidateContext("codePrefix", vertx), testContext, updated -> {
          assertThat(updated).isEqualTo(newModel).isNotEqualTo(target).isNotSameAs(target).isNotSameAs(newModel);
        });
      });
    });
  }
@ Test public void shouldUpdateOnlyTargetId ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( target -> { StoreServices . storeProfile ( new WeNetUserProfile ( ) , vertx , testContext ) . onSuccess ( profile -> { final var newModel = Model . fromBuffer ( target . toBuffer ( ) , SocialNetworkRelationship . class ) ; newModel . targetId = profile . id ; assertCanUpdate ( target , newModel , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , updated -> { assertThat ( updated ) . isEqualTo ( newModel ) . isNotEqualTo ( target ) . isNotSameAs ( target ) . isNotSameAs ( newModel ) ; } ) ; } ) ; } ) ; }
Check that update only the target identifier.
Check that update only the target identifier .