components/src/test/java/eu/internetofus/common/components/models/TaskTest.java
/**
   * Check that update when only is modified the {@link Task#attributes}.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see Task#update(Task, WeNetValidateContext)
   */
Check that update when only is modified the  Task#attributes.
@param vertx       event bus to use.
@param testContext context to test.


Check that update when only is modified the Task#attributes . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldOnlyUpdateNewAttributes(final Vertx vertx, final VertxTestContext testContext) {
    StoreServices.storeTaskExample(1, vertx, testContext).onSuccess(target -> {
      final var source = Model.fromJsonObject(target.toJsonObject(), Task.class);
      source.attributes = new JsonObject().put("a_int", 2);
      assertCanUpdate(target, source, new WeNetValidateContext("codePrefix", vertx), testContext, updated -> {
        assertThat(updated).isNotEqualTo(target).isEqualTo(source);
        target.attributes = new JsonObject().put("a_int", 2);
        assertThat(updated).isEqualTo(target);
      });
    });
  }
@ Test public void shouldOnlyUpdateNewAttributes ( final Vertx vertx , final VertxTestContext testContext ) { StoreServices . storeTaskExample ( 1 , vertx , testContext ) . onSuccess ( target -> { final var source = Model . fromJsonObject ( target . toJsonObject ( ) , Task . class ) ; source . attributes = new JsonObject ( ) . put ( "a_int" , 2 ) ; assertCanUpdate ( target , source , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext , updated -> { assertThat ( updated ) . isNotEqualTo ( target ) . isEqualTo ( source ) ; target . attributes = new JsonObject ( ) . put ( "a_int" , 2 ) ; assertThat ( updated ) . isEqualTo ( target ) ; } ) ; } ) ; }
Check that update when only is modified the {@link Task#attributes}.
Check that update when only is modified the { @link Task#attributes } .