vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should not store with defined id.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should not store with defined id.
@param vertx       event bus to use.
@param testContext context for the test.
Should not store with defined id . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldNotStoreWithDefinedId(final Vertx vertx, final VertxTestContext testContext) {
    final var document = new JsonObject().put("key1", "value").put("key2", 2).put("key3", false).put("key4",
        new JsonArray());
    testContext.assertComplete(pool.insert(TEST_COLLECTION, document).onSuccess(id -> {
      final var repository = new Repository(vertx, pool, "schemaVersion");
      document.put("_id", id);
      testContext.assertFailure(repository.storeOneDocument(TEST_COLLECTION, document, null))
          .onFailure(error -> testContext.completeNow());
    }));
  }
@ Test public void shouldNotStoreWithDefinedId ( final Vertx vertx , final VertxTestContext testContext ) { final var document = new JsonObject ( ) . put ( "key1" , "value" ) . put ( "key2" , 2 ) . put ( "key3" , false ) . put ( "key4" , new JsonArray ( ) ) ; testContext . assertComplete ( pool . insert ( TEST_COLLECTION , document ) . onSuccess ( id -> { final var repository = new Repository ( vertx , pool , "schemaVersion" ) ; document . put ( "_id" , id ) ; testContext . assertFailure ( repository . storeOneDocument ( TEST_COLLECTION , document , null ) ) . onFailure ( error -> testContext . completeNow ( ) ) ; } ) ) ; }
Should not store with defined id.
Should not store with defined id .