vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should not migrate document because a exception is thrown.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should not migrate document because a exception is thrown.
@param vertx       event bus to use.
@param testContext context for the test.
Should not migrate document because a exception is thrown . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldNotMigrateOneDocumentBecauseExceptionIsThrown(final Vertx vertx,
      final VertxTestContext testContext) {
    final var repository = new Repository(vertx, pool, "schemaVersion");
    final var maxDocuments = 10l;
    final var consumerId = UUID.randomUUID().toString();
    final var consumer = vertx.eventBus().localConsumer(consumerId);
    consumer.handler(msg -> {
      consumer.unregister();
      testContext.verify(() -> {
        assertThat(msg.body()).isInstanceOf(String.class);
        testContext.completeNow();
      });
    });
    repository.migrateOneDocument(consumerId, TEN_DUMMY_COLLECTION, null, new JsonObject(), maxDocuments);
  }
@ Test public void shouldNotMigrateOneDocumentBecauseExceptionIsThrown ( final Vertx vertx , final VertxTestContext testContext ) { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; final var maxDocuments = 10l ; final var consumerId = UUID . randomUUID ( ) . toString ( ) ; final var consumer = vertx . eventBus ( ) . localConsumer ( consumerId ) ; consumer . handler ( msg -> { consumer . unregister ( ) ; testContext . verify ( ( ) -> { assertThat ( msg . body ( ) ) . isInstanceOf ( String . class ) ; testContext . completeNow ( ) ; } ) ; } ) ; repository . migrateOneDocument ( consumerId , TEN_DUMMY_COLLECTION , null , new JsonObject ( ) , maxDocuments ) ; }
Should not migrate document because a exception is thrown.
Should not migrate document because a exception is thrown .