components/src/test/java/eu/internetofus/common/components/interaction_protocol_engine/WeNetInteractionProtocolEngineTestCase.java
/**
   * Should add get and delete an interaction.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should add get and delete an interaction.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should add get and delete an interaction . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldAddGetAndDeleteInteraction(final Vertx vertx, final VertxTestContext testContext) {
    final var interaction = new InteractionTest().createModelExample(43);
    interaction.appId = UUID.randomUUID().toString();
    this.createComponentProxy(vertx).addInteraction(interaction)
        .onComplete(testContext.succeeding(stored -> testContext.verify(() -> {
          assertThat(stored).isEqualTo(interaction);
          this.createComponentProxy(vertx).getInteractionsPage(interaction.appId, null, null, null, null, null, null,
              null, null, null, null, null, null, null, null, 0, 10)
              .onComplete(testContext.succeeding(page -> testContext.verify(() -> {
                assertThat(page).isNotNull();
                assertThat(page.total).isEqualTo(1L);
                assertThat(page.interactions).isNotNull().hasSize(1).contains(interaction);
                this.createComponentProxy(vertx)
                    .deleteInteractions(interaction.appId, null, null, null, null, null, null, null, null, null, null,
                        null, null, null)
                    .compose(empty -> this.createComponentProxy(vertx).getInteractionsPage(interaction.appId, null,
                        null, null, null, null, null, null, null, null, null, null, null, null, null, 0, 10))
                    .onComplete(testContext.succeeding(page2 -> {
                      assertThat(page2).isNotNull();
                      assertThat(page2.total).isEqualTo(0L);
                      assertThat(page2.interactions).isNullOrEmpty();
                      this.createComponentProxy(vertx).deleteInteractions(interaction.appId, null, null, null, null,
                          null, null, null, null, null, null, null, null, null)
                          .onComplete(testContext.failing(any -> testContext.completeNow()));
                    }));
              })));
        })));
  }
@ Test public void shouldAddGetAndDeleteInteraction ( final Vertx vertx , final VertxTestContext testContext ) { final var interaction = new InteractionTest ( ) . createModelExample ( 43 ) ; interaction . appId = UUID . randomUUID ( ) . toString ( ) ; this . createComponentProxy ( vertx ) . addInteraction ( interaction ) . onComplete ( testContext . succeeding ( stored -> testContext . verify ( ( ) -> { assertThat ( stored ) . isEqualTo ( interaction ) ; this . createComponentProxy ( vertx ) . getInteractionsPage ( interaction . appId , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 0 , 10 ) . onComplete ( testContext . succeeding ( page -> testContext . verify ( ( ) -> { assertThat ( page ) . isNotNull ( ) ; assertThat ( page . total ) . isEqualTo ( 1L ) ; assertThat ( page . interactions ) . isNotNull ( ) . hasSize ( 1 ) . contains ( interaction ) ; this . createComponentProxy ( vertx ) . deleteInteractions ( interaction . appId , null , null , null , null , null , null , null , null , null , null , null , null , null ) . compose ( empty -> this . createComponentProxy ( vertx ) . getInteractionsPage ( interaction . appId , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 0 , 10 ) ) . onComplete ( testContext . succeeding ( page2 -> { assertThat ( page2 ) . isNotNull ( ) ; assertThat ( page2 . total ) . isEqualTo ( 0L ) ; assertThat ( page2 . interactions ) . isNullOrEmpty ( ) ; this . createComponentProxy ( vertx ) . deleteInteractions ( interaction . appId , null , null , null , null , null , null , null , null , null , null , null , null , null ) . onComplete ( testContext . failing ( any -> testContext . completeNow ( ) ) ) ; } ) ) ; } ) ) ) ; } ) ) ) ; }
Should add get and delete an interaction.
Should add get and delete an interaction .