components/src/test/java/eu/internetofus/common/components/models/WeNetUserProfileTest.java
/**
   * Check that not merge profiles with duplicated norms.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see WeNetUserProfile#merge(WeNetUserProfile, WeNetValidateContext)
   */
Check that not merge profiles with duplicated norms.
@param vertx       event bus to use.
@param testContext context to test.


Check that not merge profiles with duplicated norms . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldNotMergeWithADuplicatedNorms(final Vertx vertx, final VertxTestContext testContext) {
    final var source = new WeNetUserProfile();
    source.norms = new ArrayList<>();
    source.norms.add(new ProtocolNormTest().createModelExample(0));
    source.norms.add(new ProtocolNormTest().createModelExample(1));
    source.norms.add(new ProtocolNormTest().createModelExample(1));
    final var target = new WeNetUserProfile();
    target.norms = new ArrayList<>();
    target.norms.add(new ProtocolNormTest().createModelExample(3));
    assertCannotMerge(target, source, "norms[2]", new WeNetValidateContext("codePrefix", vertx), testContext);
  }
@ Test public void shouldNotMergeWithADuplicatedNorms ( final Vertx vertx , final VertxTestContext testContext ) { final var source = new WeNetUserProfile ( ) ; source . norms = new ArrayList < > ( ) ; source . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 0 ) ) ; source . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 1 ) ) ; source . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 1 ) ) ; final var target = new WeNetUserProfile ( ) ; target . norms = new ArrayList < > ( ) ; target . norms . add ( new ProtocolNormTest ( ) . createModelExample ( 3 ) ) ; assertCannotMerge ( target , source , "norms[2]" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; }
Check that not merge profiles with duplicated norms.
Check that not merge profiles with duplicated norms .