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


Check that merge modify the social practice norms . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldMergeUptadingRemovingAndAddingNorms(final Vertx vertx, final VertxTestContext testContext) {
    final var target = this.createModelExample(1);
    target.id = "Id9";
    final var source = new SocialPractice();
    source.norms = new ArrayList<>();
    source.norms.add(new ProtocolNormTest().createModelExample(4));
    source.norms.add(new ProtocolNormTest().createModelExample(1));
    source.norms.get(1).whenever = "New attribute";
    assertCanMerge(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, merged -> {
      assertThat(merged).isNotEqualTo(target).isNotEqualTo(source);
      target.norms.clear();
      target.norms.add(new ProtocolNormTest().createModelExample(4));
      target.norms.add(new ProtocolNormTest().createModelExample(1));
      target.norms.get(1).whenever = "New attribute";
      assertThat(merged).isEqualTo(target);
    });
  }
@ Test public void shouldMergeUptadingRemovingAndAddingNorms ( final Vertx vertx , final VertxTestContext testContext ) { final var target = this . createModelExample ( 1 ) ; target . id = "Id9" ; final var source = new SocialPractice ( ) ; source . norms = new ArrayList < > ( ) ; source . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 4 ) ) ; source . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 1 ) ) ; source . norms . get ( 1 ) . whenever = "New attribute" ; assertCanMerge ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , merged -> { assertThat ( merged ) . isNotEqualTo ( target ) . isNotEqualTo ( source ) ; target . norms . clear ( ) ; target . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 4 ) ) ; target . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 1 ) ) ; target . norms . get ( 1 ) . whenever = "New attribute" ; assertThat ( merged ) . isEqualTo ( target ) ; } ) ; }
Check that merge modify the social practice norms.
Check that merge modify the social practice norms .