vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should fail upsert document.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should fail upsert document.
@param vertx       event bus to use.
@param testContext context for the test.
Should fail upsert document . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldFailUsertDocument(final Vertx vertx, final VertxTestContext testContext) {
    final var repository = new Repository(vertx, pool, "schemaVersion");
    final var query = new JsonObject().put("identifier", UUID.randomUUID().toString());
    final var newDoc = new JsonObject().put("index", 100).putNull("key1").put("key3", true);
    testContext.assertFailure(repository.upsertOneDocument(TEST_COLLECTION, query, newDoc, false))
        .onFailure(error -> testContext.completeNow());
  }
@ Test public void shouldFailUsertDocument ( final Vertx vertx , final VertxTestContext testContext ) { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; final var query = new JsonObject ( ) . put ( "identifier" , UUID . randomUUID ( ) . toString ( ) ) ; final var newDoc = new JsonObject ( ) . put ( "index" , 100 ) . putNull ( "key1" ) . put ( "key3" , true ) ; testContext . assertFailure ( repository . upsertOneDocument ( TEST_COLLECTION , query , newDoc , false ) ) . onFailure ( error -> testContext . completeNow ( ) ) ; }
Should fail upsert document.
Should fail upsert document .