vertx/src/test/java/eu/internetofus/common/vertx/RepositoryIT.java
/**
   * Should not migrate with bad query.
   *
   * @param vertx       event bus to use.
   * @param testContext context for the test.
   */
Should not migrate with bad query.
@param vertx       event bus to use.
@param testContext context for the test.
Should not migrate with bad query . @param vertx event bus to use . @param testContext context for the test .
@Test
  public void shouldNotMigrateCollectionWithBadQuery(final Vertx vertx, final VertxTestContext testContext) {
    final Repository repository = new Repository(vertx, pool, "schemaVersion") {
      /**
       * {@inheritDoc}
       */
      @Override
      protected JsonObject createQueryToReturnDocumentsWithAVersionLessThan(final String version) {
        return new JsonObject().put(Repository.SCHEMA_VERSION, new JsonObject().put("$undefinedOperator", "value"));
      }
    };
    testContext.assertFailure(repository.migrateCollection(EMPTY_COLLECTION, DummyModel.class, "schemaVersion"))
        .onFailure(error -> testContext.completeNow());
  }
@ Test public void shouldNotMigrateCollectionWithBadQuery ( final Vertx vertx , final VertxTestContext testContext ) { final Repository repository = new Repository ( vertx , pool , "schemaVersion" ) { /**
       * {@inheritDoc}
       */ @ Override protected JsonObject createQueryToReturnDocumentsWithAVersionLessThan ( final String version ) { return new JsonObject ( ) . put ( Repository . SCHEMA_VERSION , new JsonObject ( ) . put ( "$undefinedOperator" , "value" ) ) ; } } ; testContext . assertFailure ( repository . migrateCollection ( EMPTY_COLLECTION , DummyModel . class , "schemaVersion" ) ) . onFailure ( error -> testContext . completeNow ( ) ) ; }
Should not migrate with bad query.
Should not migrate with bad query .