components/src/test/java/eu/internetofus/common/components/models/CommunityProfileTest.java
/**
   * Check update social practices profiles.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see WeNetUserProfile#update(WeNetUserProfile, WeNetValidateContext)
   */
Check update social practices profiles.
@param vertx       event bus to use.
@param testContext context to test.


Check update social practices profiles . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldUpdateWithSocialPractices(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onSuccess(target -> {
      target.socialPractices = new ArrayList<>();
      target.socialPractices.add(new SocialPractice());
      target.socialPractices.get(0).id = "1";
      final var source = Model.fromJsonObject(target.toJsonObject(), CommunityProfile.class);
      source.socialPractices = new ArrayList<>();
      source.socialPractices.add(new SocialPractice());
      source.socialPractices.add(new SocialPractice());
      source.socialPractices.add(new SocialPractice());
      source.socialPractices.get(1).id = "1";
      assertCanUpdate(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, updated -> {
        assertThat(updated.socialPractices).isNotEqualTo(target.socialPractices).isEqualTo(source.socialPractices);
        assertThat(updated.socialPractices.get(0).id).isNotEmpty();
        assertThat(updated.socialPractices.get(1).id).isEqualTo("1");
        assertThat(updated.socialPractices.get(2).id).isNotEmpty();
      });
    });
  }
@ Test public void shouldUpdateWithSocialPractices ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( target -> { target . socialPractices = new ArrayList < > ( ) ; target . socialPractices . add ( new SocialPractice ( ) ) ; target . socialPractices . get ( 0 ) . id = "1" ; final var source = Model . fromJsonObject ( target . toJsonObject ( ) , CommunityProfile . class ) ; source . socialPractices = new ArrayList < > ( ) ; source . socialPractices . add ( new SocialPractice ( ) ) ; source . socialPractices . add ( new SocialPractice ( ) ) ; source . socialPractices . add ( new SocialPractice ( ) ) ; source . socialPractices . get ( 1 ) . id = "1" ; assertCanUpdate ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , updated -> { assertThat ( updated . socialPractices ) . isNotEqualTo ( target . socialPractices ) . isEqualTo ( source . socialPractices ) ; assertThat ( updated . socialPractices . get ( 0 ) . id ) . isNotEmpty ( ) ; assertThat ( updated . socialPractices . get ( 1 ) . id ) . isEqualTo ( "1" ) ; assertThat ( updated . socialPractices . get ( 2 ) . id ) . isNotEmpty ( ) ; } ) ; } ) ; }
Check update social practices profiles.
Check update social practices profiles .