model/src/test/java/eu/internetofus/common/model/MergesTest.java
/**
   * Check that merge {@code null} source into a target model.
   *
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @see Merges#mergeField
   */
Check that merge  null source into a target model.
@param vertx       event bus to use.
@param testContext test context to use.

@see Merges#mergeField
Check that merge null source into a target model . @param vertx event bus to use . @param testContext test context to use . @see Merges#mergeField
@Test
  public void shouldMergeNullSourceAndNotNullTargetField(final Vertx vertx, final VertxTestContext testContext) {
    final var model = new DummyComplexModelTest().createModelExample(1);
    final var target = new DummyComplexModelTest().createModelExample(2);
    Future.succeededFuture(model)
        .compose(Merges.mergeField(new DummyValidateContext("codePrefix"), "other", target, null,
            (mergedModel, field) -> mergedModel.other = field))
        .onComplete(testContext.succeeding(merged -> testContext.verify(() -> {
          assertThat(merged).isSameAs(model);
          assertThat(merged.other).isSameAs(target);
          testContext.completeNow();
        })));
  }
@ Test public void shouldMergeNullSourceAndNotNullTargetField ( final Vertx vertx , final VertxTestContext testContext ) { final var model = new DummyComplexModelTest ( ) . createModelExample ( 1 ) ; final var target = new DummyComplexModelTest ( ) . createModelExample ( 2 ) ; Future . succeededFuture ( model ) . compose ( Merges . mergeField ( new DummyValidateContext ( "codePrefix" ) , "other" , target , null , ( mergedModel , field ) -> mergedModel . other = field ) ) . onComplete ( testContext . succeeding ( merged -> testContext . verify ( ( ) -> { assertThat ( merged ) . isSameAs ( model ) ; assertThat ( merged . other ) . isSameAs ( target ) ; testContext . completeNow ( ) ; } ) ) ) ; }
Check that merge {@code null} source into a target model.
Check that merge { @code null } source into a target model .