components/src/test/java/eu/internetofus/common/components/models/SocialPracticeTest.java
/**
   * Check that update social practice norms.
   *
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @see SocialPractice#update(SocialPractice, WeNetValidateContext)
   */
Check that update social practice norms.
@param vertx       event bus to use.
@param testContext test context to use.


Check that update social practice norms . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldUpdateNorms(final Vertx vertx, final VertxTestContext testContext) {
    final var target = this.createModelExample(1);
    target.id = "9";
    final var source = new SocialPractice();
    source.norms = new ArrayList<>();
    for (final var norm : target.norms) {
      source.norms.add(Model.fromJsonObject(norm.toJsonObject(), ProtocolNorm.class));
    }
    source.norms.get(0).whenever = "New attribute";
    assertCanUpdate(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, updated -> {
      assertThat(updated).isNotEqualTo(target).isNotEqualTo(source);
      source.id = target.id;
      assertThat(updated).isEqualTo(source);
    });
  }
@ Test public void shouldUpdateNorms ( final Vertx vertx , final VertxTestContext testContext ) { final var target = this . createModelExample ( 1 ) ; target . id = "9" ; final var source = new SocialPractice ( ) ; source . norms = new ArrayList < > ( ) ; for ( final var norm : target . norms ) { source . norms . add ( Model . fromJsonObject ( norm . toJsonObject ( ) , ProtocolNorm . class ) ) ; } source . norms . get ( 0 ) . whenever = "New attribute" ; assertCanUpdate ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , updated -> { assertThat ( updated ) . isNotEqualTo ( target ) . isNotEqualTo ( source ) ; source . id = target . id ; assertThat ( updated ) . isEqualTo ( source ) ; } ) ; }
Check that update social practice norms.
Check that update social practice norms .