protocols/src/test/java/eu/internetofus/common/protocols/AbstractProtocolITC.java
/**
   * Wait until has received the specified interactions.
   *
   * @param vertx             event bus to use.
   * @param testContext       context to do the test.
   * @param checkInteractions the functions that has all to be {@code true} to
   *                          stop waiting.
   *
   * @return the interactions that satisfy the predicates.
   */
Wait until has received the specified interactions.
@param vertx             event bus to use.
@param testContext       context to do the test.
@param checkInteractions the functions that has all to be  true to
stop waiting.

@return the interactions that satisfy the predicates.
Wait until has received the specified interactions . @param vertx event bus to use . @param testContext context to do the test . @param checkInteractions the functions that has all to be true to stop waiting . @return the interactions that satisfy the predicates .
protected Future<InteractionsPage> waitUntilInteractions(@NotNull final Vertx vertx,
      @NotNull final VertxTestContext testContext, @NotNull final List<Predicate<Interaction>> checkInteractions) {
    return this
        .waitUntil(vertx, testContext, () -> WeNetInteractionProtocolEngine.createProxy(vertx).getInteractionsPage(null,
            null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, 100), page -> {
              if (page.interactions == null || page.interactions.isEmpty()) {
                return false;
              } else {
                final List<Predicate<Interaction>> copy = new ArrayList<>(checkInteractions);
                final var interactionsIter = page.interactions.iterator();
                while (interactionsIter.hasNext()) {
                  final var interaction = interactionsIter.next();
                  if (interaction != null) {
                    final var iter = copy.iterator();
                    while (iter.hasNext()) {
                      final var checkInteraction = iter.next();
                      if (checkInteraction.test(interaction)) {
                        iter.remove();
                        break;
                      }
                    }
                  }
                  interactionsIter.remove();
                }
                return copy.isEmpty();
              }
            })
        .compose(page -> WeNetInteractionProtocolEngine.createProxy(vertx)
            .deleteInteractions(this.app.appId, this.community.id, this.taskType.id, this.task.id, null, null, null,
                null, null, null, null, null, null, null)
            .map(empty -> page));
  }
protected Future < InteractionsPage > waitUntilInteractions ( @ NotNull final Vertx vertx , @ NotNull final VertxTestContext testContext , @ NotNull final List < Predicate < Interaction > > checkInteractions ) { return this . waitUntil ( vertx , testContext , ( ) -> WeNetInteractionProtocolEngine . createProxy ( vertx ) . getInteractionsPage ( null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 0 , 100 ) , page -> { if ( page . interactions == null || page . interactions . isEmpty ( ) ) { return false ; } else { final List < Predicate < Interaction > > copy = new ArrayList < > ( checkInteractions ) ; final var interactionsIter = page . interactions . iterator ( ) ; while ( interactionsIter . hasNext ( ) ) { final var interaction = interactionsIter . next ( ) ; if ( interaction != null ) { final var iter = copy . iterator ( ) ; while ( iter . hasNext ( ) ) { final var checkInteraction = iter . next ( ) ; if ( checkInteraction . test ( interaction ) ) { iter . remove ( ) ; break ; } } } interactionsIter . remove ( ) ; } return copy . isEmpty ( ) ; } } ) . compose ( page -> WeNetInteractionProtocolEngine . createProxy ( vertx ) . deleteInteractions ( this . app . appId , this . community . id , this . taskType . id , this . task . id , null , null , null , null , null , null , null , null , null , null ) . map ( empty -> page ) ) ; }
Wait until has received the specified interactions.
Wait until has received the specified interactions .