components/src/test/java/eu/internetofus/common/components/models/CommunityProfileTest.java
/**
   * Should not update with a bad social practice.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see CommunityProfile#update(CommunityProfile, WeNetValidateContext)
   */
Should not update with a bad social practice.
@param vertx       event bus to use.
@param testContext context to test.


Should not update with a bad social practice . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldNotUpdateWithBadSocialPractices(final Vertx vertx, final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onSuccess(target -> {
      final var source = Model.fromJsonObject(target.toJsonObject(), CommunityProfile.class);
      source.socialPractices = new ArrayList<>();
      source.socialPractices.add(new SocialPracticeTest().createModelExample(1));
      source.socialPractices.add(new SocialPracticeTest().createModelExample(2));
      source.socialPractices.get(1).materials.get(0).name = null;
      assertCannotUpdate(target, source, "socialPractices[1].materials[0].name",
          new WeNetValidateContext("codePrefix", vertx), testContext);
    });
  }
@ Test public void shouldNotUpdateWithBadSocialPractices ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onSuccess ( target -> { final var source = Model . fromJsonObject ( target . toJsonObject ( ) , CommunityProfile . class ) ; source . socialPractices = new ArrayList < > ( ) ; source . socialPractices . add ( new SocialPracticeTest ( ) . createModelExample ( 1 ) ) ; source . socialPractices . add ( new SocialPracticeTest ( ) . createModelExample ( 2 ) ) ; source . socialPractices . get ( 1 ) . materials . get ( 0 ) . name = null ; assertCannotUpdate ( target , source , "socialPractices[1].materials[0].name" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; } ) ; }
Should not update with a bad social practice.
Should not update with a bad social practice .