protocols/src/test/java/eu/internetofus/common/protocols/AbstractAsk4HelpV2_2ProtocolRandomUsersITC.java
/**
   * Check that can report answer.
   *
   * @param vertx       event bus to use.
   * @param testContext context to do the test.
   */
Check that can report answer.
@param vertx       event bus to use.
@param testContext context to do the test.
Check that can report answer . @param vertx event bus to use . @param testContext context to do the test .
@Test
  @Order(7)
  public void shouldReportAnswerTransaction(final Vertx vertx, final VertxTestContext testContext) {
    this.assertLastSuccessfulTestWas(6, testContext);
    final var reportAnswerTransaction = new TaskTransaction();
    reportAnswerTransaction.taskId = this.task.id;
    reportAnswerTransaction.actioneerId = this.task.requesterId;
    reportAnswerTransaction.label = "reportAnswerTransaction";
    reportAnswerTransaction.attributes = new JsonObject()
        .put("transactionId", this.task.transactions.get(this.task.transactions.size() - 1).id)
        .put("reason", "abusive");
    final var checkTask = this.createTaskPredicate().and(TaskPredicates.lastTransactionIs(
        this.createTaskTransactionPredicate().and(TaskTransactionPredicates.similarTo(reportAnswerTransaction))));
    final Future<?> future = WeNetTaskManager.createProxy(vertx).doTaskTransaction(reportAnswerTransaction)
        .compose(ignored -> this.waitUntilTask(vertx, testContext, checkTask));
    future.onComplete(testContext.succeeding(ignored -> this.assertSuccessfulCompleted(testContext)));
  }
@ Test @ Order ( 7 ) public void shouldReportAnswerTransaction ( final Vertx vertx , final VertxTestContext testContext ) { this . assertLastSuccessfulTestWas ( 6 , testContext ) ; final var reportAnswerTransaction = new TaskTransaction ( ) ; reportAnswerTransaction . taskId = this . task . id ; reportAnswerTransaction . actioneerId = this . task . requesterId ; reportAnswerTransaction . label = "reportAnswerTransaction" ; reportAnswerTransaction . attributes = new JsonObject ( ) . put ( "transactionId" , this . task . transactions . get ( this . task . transactions . size ( ) - 1 ) . id ) . put ( "reason" , "abusive" ) ; final var checkTask = this . createTaskPredicate ( ) . and ( TaskPredicates . lastTransactionIs ( this . createTaskTransactionPredicate ( ) . and ( TaskTransactionPredicates . similarTo ( reportAnswerTransaction ) ) ) ) ; final Future < ? > future = WeNetTaskManager . createProxy ( vertx ) . doTaskTransaction ( reportAnswerTransaction ) . compose ( ignored -> this . waitUntilTask ( vertx , testContext , checkTask ) ) ; future . onComplete ( testContext . succeeding ( ignored -> this . assertSuccessfulCompleted ( testContext ) ) ) ; }
Check that can report answer.
Check that can report answer .