protocols/src/test/java/eu/internetofus/common/protocols/AbstractProtocolITC.java
/**
   * Check that is send the specified task transaction status.
   *
   * @param vertx       event bus to use.
   * @param testContext context to do the test.
   * @param checkStatus this predicate is true when the task transaction status
   *                    has the expected values.
   *
   * @return the future notified task transaction.
   *
   * @see #waitUntilTask(Vertx, VertxTestContext, Predicate)
   */
Check that is send the specified task transaction status.
@param vertx       event bus to use.
@param testContext context to do the test.
@param checkStatus this predicate is true when the task transaction status
has the expected values.

@return the future notified task transaction.


Check that is send the specified task transaction status . @param vertx event bus to use . @param testContext context to do the test . @param checkStatus this predicate is true when the task transaction status has the expected values . @return the future notified task transaction .
protected Future<List<TaskTransactionStatusBody>> waitUntilIncentiveServerHasTaskTransactionStatus(
      @NotNull final Vertx vertx, @NotNull final VertxTestContext testContext,
      @NotNull final List<Predicate<TaskTransactionStatusBody>> checkStatus) {
    return this.waitUntil(vertx, testContext,
        () -> WeNetIncentiveServerSimulator.createProxy(vertx).getTaskTransactionStatus(), status -> {
          final List<Predicate<TaskTransactionStatusBody>> copy = new ArrayList<>(checkStatus);
          final var statusIter = status.iterator();
          while (statusIter.hasNext()) {
            var state = statusIter.next();
            final var iter = copy.iterator();
            while (iter.hasNext()) {
              final var check = iter.next();
              if (check.test(state)) {
                iter.remove();
                state = null;
                break;
              }
            }
            if (state != null) {
              statusIter.remove();
            }
          }
          return copy.isEmpty();
        }).compose(status -> WeNetIncentiveServerSimulator.createProxy(vertx).deleteTaskTransactionStatus()
            .map(ignored -> status));
  }
protected Future < List < TaskTransactionStatusBody > > waitUntilIncentiveServerHasTaskTransactionStatus ( @ NotNull final Vertx vertx , @ NotNull final VertxTestContext testContext , @ NotNull final List < Predicate < TaskTransactionStatusBody > > checkStatus ) { return this . waitUntil ( vertx , testContext , ( ) -> WeNetIncentiveServerSimulator . createProxy ( vertx ) . getTaskTransactionStatus ( ) , status -> { final List < Predicate < TaskTransactionStatusBody > > copy = new ArrayList < > ( checkStatus ) ; final var statusIter = status . iterator ( ) ; while ( statusIter . hasNext ( ) ) { var state = statusIter . next ( ) ; final var iter = copy . iterator ( ) ; while ( iter . hasNext ( ) ) { final var check = iter . next ( ) ; if ( check . test ( state ) ) { iter . remove ( ) ; state = null ; break ; } } if ( state != null ) { statusIter . remove ( ) ; } } return copy . isEmpty ( ) ; } ) . compose ( status -> WeNetIncentiveServerSimulator . createProxy ( vertx ) . deleteTaskTransactionStatus ( ) . map ( ignored -> status ) ) ; }
Check that is send the specified task transaction status.
Check that is send the specified task transaction status .