vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should fond one document.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should fond one document.
@param vertx       event bus to use.
@param testContext context for the test.
Should fond one document . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldFindOneDocument(final Vertx vertx, final VertxTestContext testContext) {
    final var repository = new Repository(vertx, pool, "schemaVersion");
    testContext.assertComplete(repository.findOneDocument(TEN_DUMMY_COLLECTION,
        new JsonObject().put("index", new JsonObject().put("$mod", new JsonArray().add(2).add(0))),
        new JsonObject().put("index", false), model -> {
          model.remove("_id");
          return model;
        })).onSuccess(found -> testContext.verify(() -> {
          assertThat(found).isEqualTo(new JsonObject());
          testContext.completeNow();
        }));
  }
@ Test public void shouldFindOneDocument ( final Vertx vertx , final VertxTestContext testContext ) { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; testContext . assertComplete ( repository . findOneDocument ( TEN_DUMMY_COLLECTION , new JsonObject ( ) . put ( "index" , new JsonObject ( ) . put ( "$mod" , new JsonArray ( ) . add ( 2 ) . add ( 0 ) ) ) , new JsonObject ( ) . put ( "index" , false ) , model -> { model . remove ( "_id" ) ; return model ; } ) ) . onSuccess ( found -> testContext . verify ( ( ) -> { assertThat ( found ) . isEqualTo ( new JsonObject ( ) ) ; testContext . completeNow ( ) ; } ) ) ; }
Should fond one document.
Should fond one document .