protocols/src/test/java/eu/internetofus/common/protocols/EchoV1ProtocolITC.java
/**
   * Check that a task is created.
   *
   * @param vertx       event bus to use.
   * @param testContext context to do the test.
   */
Check that a task is created.
@param vertx       event bus to use.
@param testContext context to do the test.
Check that a task is created . @param vertx event bus to use . @param testContext context to do the test .
@Test
  @Order(5)
  public void shouldCreateTask(final Vertx vertx, final VertxTestContext testContext) {
    this.assertLastSuccessfulTestWas(4, testContext);
    final var source = this.createTaskForProtocol();
    final var expectedTransaction = new TaskTransaction();
    expectedTransaction.actioneerId = source.requesterId;
    expectedTransaction.label = source.requesterId;
    final var checkIncentiveTypeStatus = new ArrayList<Predicate<TaskTypeStatusBody>>();
    checkIncentiveTypeStatus.add(this.createIncentiveServerTaskTypeStatusPredicate()
        .and(TaskTypeStatusBodyPredicates.userIs(source.requesterId)).and(TaskTypeStatusBodyPredicates.countIs(1)));
    final var future = this
        .waitUntilTaskCreated(source, vertx, testContext,
            TaskPredicates.similarTo(source).and(TaskPredicates.transactionSizeIs(1))
                .and(TaskPredicates.transactionAt(0, TaskTransactionPredicates.withoutMessages())))
        .compose(
            ignored -> this.waitUntilIncentiveServerHasTaskTypeStatus(vertx, testContext, checkIncentiveTypeStatus));
    future.onComplete(testContext.succeeding(ignored -> this.assertSuccessfulCompleted(testContext)));
  }
@ Test @ Order ( 5 ) public void shouldCreateTask ( final Vertx vertx , final VertxTestContext testContext ) { this . assertLastSuccessfulTestWas ( 4 , testContext ) ; final var source = this . createTaskForProtocol ( ) ; final var expectedTransaction = new TaskTransaction ( ) ; expectedTransaction . actioneerId = source . requesterId ; expectedTransaction . label = source . requesterId ; final var checkIncentiveTypeStatus = new ArrayList < Predicate < TaskTypeStatusBody > > ( ) ; checkIncentiveTypeStatus . add ( this . createIncentiveServerTaskTypeStatusPredicate ( ) . and ( TaskTypeStatusBodyPredicates . userIs ( source . requesterId ) ) . and ( TaskTypeStatusBodyPredicates . countIs ( 1 ) ) ) ; final var future = this . waitUntilTaskCreated ( source , vertx , testContext , TaskPredicates . similarTo ( source ) . and ( TaskPredicates . transactionSizeIs ( 1 ) ) . and ( TaskPredicates . transactionAt ( 0 , TaskTransactionPredicates . withoutMessages ( ) ) ) ) . compose ( ignored -> this . waitUntilIncentiveServerHasTaskTypeStatus ( vertx , testContext , checkIncentiveTypeStatus ) ) ; future . onComplete ( testContext . succeeding ( ignored -> this . assertSuccessfulCompleted ( testContext ) ) ) ; }
Check that a task is created.
Check that a task is created .