vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should return an empty page if no documents on collection.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should return an empty page if no documents on collection.
@param vertx       event bus to use.
@param testContext context for the test.
Should return an empty page if no documents on collection . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldSearchPageObjectIsEmpty(final Vertx vertx, final VertxTestContext testContext) {
    final var repository = new Repository(vertx, pool, "schemaVersion");
    final var options = new FindOptions();
    options.setLimit(1000);
    testContext.assertComplete(repository.searchPageObject(EMPTY_COLLECTION, new JsonObject(), options, "models", null))
        .onSuccess(page -> testContext.verify(() -> {
          assertThat(page).isNotNull();
          assertThat(page.getInteger("offset")).isNotNull().isEqualTo(0);
          assertThat(page.getInteger("total")).isNotNull().isEqualTo(0);
          assertThat(page.containsKey("models")).isFalse();
          testContext.completeNow();
        }));
  }
@ Test public void shouldSearchPageObjectIsEmpty ( final Vertx vertx , final VertxTestContext testContext ) { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; final var options = new FindOptions ( ) ; options . setLimit ( 1000 ) ; testContext . assertComplete ( repository . searchPageObject ( EMPTY_COLLECTION , new JsonObject ( ) , options , "models" , null ) ) . onSuccess ( page -> testContext . verify ( ( ) -> { assertThat ( page ) . isNotNull ( ) ; assertThat ( page . getInteger ( "offset" ) ) . isNotNull ( ) . isEqualTo ( 0 ) ; assertThat ( page . getInteger ( "total" ) ) . isNotNull ( ) . isEqualTo ( 0 ) ; assertThat ( page . containsKey ( "models" ) ) . isFalse ( ) ; testContext . completeNow ( ) ; } ) ) ; }
Should return an empty page if no documents on collection.
Should return an empty page if no documents on collection .