vertx/src/test/java/eu/internetofus/common/vertx/RepositoryTest.java
/**
   * Check search communities fail because can not find.
   *
   * @param pool        mocked MongoDB client.
   * @param vertx       event bus to use.
   * @param testContext test context.
   */
Check search communities fail because can not find.
@param pool        mocked MongoDB client.
@param vertx       event bus to use.
@param testContext test context.
Check search communities fail because can not find . @param pool mocked MongoDB client . @param vertx event bus to use . @param testContext test context .
@Test
  public void shouldSearchPageObjectFailedByMongoClientFind(@Mock final MongoClient pool, final Vertx vertx,
      final VertxTestContext testContext) {
    final var repository = new Repository(vertx, pool, "version");
    doReturn(Future.succeededFuture(100L)).when(pool).count(any(), any());
    doReturn(Future.failedFuture("Internal error")).when(pool).findWithOptions(any(), any(), any());
    testContext.assertFailure(repository.searchPageObject(null, null, new FindOptions(), null, null))
        .onFailure(error -> testContext.completeNow());
  }
@ Test public void shouldSearchPageObjectFailedByMongoClientFind ( @ Mock final MongoClient pool , final Vertx vertx , final VertxTestContext testContext ) { final var repository = new Repository ( vertx , pool , "version" ) ; doReturn ( Future . succeededFuture ( 100L ) ) . when ( pool ) . count ( any ( ) , any ( ) ) ; doReturn ( Future . failedFuture ( "Internal error" ) ) . when ( pool ) . findWithOptions ( any ( ) , any ( ) , any ( ) ) ; testContext . assertFailure ( repository . searchPageObject ( null , null , new FindOptions ( ) , null , null ) ) . onFailure ( error -> testContext . completeNow ( ) ) ; }
Check search communities fail because can not find.
Check search communities fail because can not find .