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


Check that not accept profiles with bad materials . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldNotMergeWithABadMaterials(final Vertx vertx, final VertxTestContext testContext) {
    final var source = new WeNetUserProfile();
    source.materials = new ArrayList<>();
    source.materials.add(new MaterialTest().createModelExample(1));
    source.materials.add(new MaterialTest().createModelExample(2));
    source.materials.add(new MaterialTest().createModelExample(3));
    source.materials.get(1).name = null;
    assertCannotMerge(new WeNetUserProfile(), source, "materials[1].name",
        new WeNetValidateContext("codePrefix", vertx), testContext);
  }
@ Test public void shouldNotMergeWithABadMaterials ( final Vertx vertx , final VertxTestContext testContext ) { final var source = new WeNetUserProfile ( ) ; source . materials = new ArrayList < > ( ) ; source . materials . add ( new MaterialTest ( ) . createModelExample ( 1 ) ) ; source . materials . add ( new MaterialTest ( ) . createModelExample ( 2 ) ) ; source . materials . add ( new MaterialTest ( ) . createModelExample ( 3 ) ) ; source . materials . get ( 1 ) . name = null ; assertCannotMerge ( new WeNetUserProfile ( ) , source , "materials[1].name" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; }
Check that not accept profiles with bad materials.
Check that not accept profiles with bad materials .