components/src/test/java/eu/internetofus/common/components/models/TaskTransactionTest.java
/**
   * A task transaction be valid when missing a nullable attribute.
   *
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @see TaskTransaction#validate(WeNetValidateContext)
   */
A task transaction be valid when missing a nullable attribute.
@param vertx       event bus to use.
@param testContext test context to use.


A task transaction be valid when missing a nullable attribute . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldTaskTransactionBeValidWithTaskTypeWithLabelButMissingNullableAttributes(final Vertx vertx,
      final VertxTestContext testContext) {
    this.createModelExample(1, vertx, testContext).onComplete(testContext.succeeding(model -> {
      WeNetTaskManager.createProxy(vertx).retrieveTask(model.taskId).compose(task -> {
        final var newType = new TaskType();
        newType.id = task.taskTypeId;
        newType.transactions = new JsonObject().put(model.label,
            new JsonObject().put("type", "object").put("properties",
                new JsonObject().put("arg1", new JsonObject().put("type", "string").put("nullable", true)).put("arg2",
                    new JsonObject().put("type", "string").put("nullable", true))));
        return WeNetTaskManager.createProxy(vertx).mergeTaskType(task.taskTypeId, newType);
      }).onComplete(testContext
          .succeeding(empty -> assertIsValid(model, new WeNetValidateContext("codePrefix", vertx), testContext)));
    }));
  }
@ Test public void shouldTaskTransactionBeValidWithTaskTypeWithLabelButMissingNullableAttributes ( final Vertx vertx , final VertxTestContext testContext ) { this . createModelExample ( 1 , vertx , testContext ) . onComplete ( testContext . succeeding ( model -> { WeNetTaskManager . createProxy ( vertx ) . retrieveTask ( model . taskId ) . compose ( task -> { final var newType = new TaskType ( ) ; newType . id = task . taskTypeId ; newType . transactions = new JsonObject ( ) . put ( model . label , new JsonObject ( ) . put ( "type" , "object" ) . put ( "properties" , new JsonObject ( ) . put ( "arg1" , new JsonObject ( ) . put ( "type" , "string" ) . put ( "nullable" , true ) ) . put ( "arg2" , new JsonObject ( ) . put ( "type" , "string" ) . put ( "nullable" , true ) ) ) ) ; return WeNetTaskManager . createProxy ( vertx ) . mergeTaskType ( task . taskTypeId , newType ) ; } ) . onComplete ( testContext . succeeding ( empty -> assertIsValid ( model , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ) ) ; } ) ) ; }
A task transaction be valid when missing a nullable attribute.
A task transaction be valid when missing a nullable attribute .