vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should delete document.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should delete document.
@param vertx       event bus to use.
@param testContext context for the test.
Should delete document . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldDeleteDocument(final Vertx vertx, final VertxTestContext testContext) {
    pool.insert(TEST_COLLECTION, new JsonObject().put("index", -1567), testContext.succeeding(id -> {
      final var repository = new Repository(vertx, pool, "schemaVersion");
      final var query = new JsonObject().put("index", -1567);
      testContext.assertComplete(
          repository.deleteOneDocument(TEST_COLLECTION, query).compose(deleted -> pool.find(TEST_COLLECTION, query)))
          .onSuccess(value -> testContext.verify(() -> {
            assertThat(value).isEmpty();
            testContext.completeNow();
          }));
    }));
  }
@ Test public void shouldDeleteDocument ( final Vertx vertx , final VertxTestContext testContext ) { pool . insert ( TEST_COLLECTION , new JsonObject ( ) . put ( "index" , - 1567 ) , testContext . succeeding ( id -> { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; final var query = new JsonObject ( ) . put ( "index" , - 1567 ) ; testContext . assertComplete ( repository . deleteOneDocument ( TEST_COLLECTION , query ) . compose ( deleted -> pool . find ( TEST_COLLECTION , query ) ) ) . onSuccess ( value -> testContext . verify ( ( ) -> { assertThat ( value ) . isEmpty ( ) ; testContext . completeNow ( ) ; } ) ) ; } ) ) ; }
Should delete document.
Should delete document .