vertx/src/test/java/eu/internetofus/common/vertx/AbstractMainTest.java
/**
   * Should not store effective configuration.
   *
   * @param testContext test context over the event bus.
   * @param tmpDir      temporal directory.
   *
   * @throws Throwable if can not create the temporal files.
   */
Should not store effective configuration.
@param testContext test context over the event bus.
@param tmpDir      temporal directory.

@throws Throwable if can not create the temporal files.
Should not store effective configuration . @param testContext test context over the event bus . @param tmpDir temporal directory . @throws Throwable if can not create the temporal files .
@Test
  public void shouldNotStoreEffectiveConfiguration(final VertxTestContext testContext, @TempDir final File tmpDir)
      throws Throwable {
    final var effectiveConf = new File(tmpDir, "conf.json");
    this.main
        .startWith(
            "-" + AbstractMain.PROPERTY_OPTION + AbstractMain.EFFECTIVE_CONFIGURATION_PATH + "=\""
                + effectiveConf.getAbsolutePath() + "\"",
            "-" + AbstractMain.PROPERTY_OPTION + AbstractMain.STORE_EFFECTIVE_CONFIGURATION + "=false",
            "-" + AbstractMain.PROPERTY_OPTION + "key1=123", "-" + AbstractMain.PROPERTY_OPTION + "key2=\"Two\"",
            "-" + AbstractMain.PROPERTY_OPTION + " persistence.db_name=\"database name\"",
            "-" + AbstractMain.PROPERTY_OPTION + " api.port=8765", "-" + AbstractMain.PROPERTY_OPTION + "key3=false")
        .onComplete(testContext.succeeding(handler -> testContext.verify(() -> {
          try {
            final var value = IOUtils.toString(new FileReader(effectiveConf));
            new JsonObject(value);
            testContext.failNow(new Throwable("Stored effective configuration"));
          } catch (final Throwable t) {
            testContext.completeNow();
          }
        })));
    @SuppressWarnings("unchecked")
    final ArgumentCaptor<Promise<Void>> startPromise = ArgumentCaptor.forClass(Promise.class);
    verify(this.main.verticle, timeout(30000).times(1)).start(startPromise.capture());
    startPromise.getValue().complete();
  }
@ Test public void shouldNotStoreEffectiveConfiguration ( final VertxTestContext testContext , @ TempDir final File tmpDir ) throws Throwable { final var effectiveConf = new File ( tmpDir , "conf.json" ) ; this . main . startWith ( "-" + AbstractMain . PROPERTY_OPTION + AbstractMain . EFFECTIVE_CONFIGURATION_PATH + "=\"" + effectiveConf . getAbsolutePath ( ) + "\"" , "-" + AbstractMain . PROPERTY_OPTION + AbstractMain . STORE_EFFECTIVE_CONFIGURATION + "=false" , "-" + AbstractMain . PROPERTY_OPTION + "key1=123" , "-" + AbstractMain . PROPERTY_OPTION + "key2=\"Two\"" , "-" + AbstractMain . PROPERTY_OPTION + " persistence.db_name=\"database name\"" , "-" + AbstractMain . PROPERTY_OPTION + " api.port=8765" , "-" + AbstractMain . PROPERTY_OPTION + "key3=false" ) . onComplete ( testContext . succeeding ( handler -> testContext . verify ( ( ) -> { try { final var value = IOUtils . toString ( new FileReader ( effectiveConf ) ) ; new JsonObject ( value ) ; testContext . failNow ( new Throwable ( "Stored effective configuration" ) ) ; } catch ( final Throwable t ) { testContext . completeNow ( ) ; } } ) ) ) ; @ SuppressWarnings ( "unchecked" ) final ArgumentCaptor < Promise < Void > > startPromise = ArgumentCaptor . forClass ( Promise . class ) ; verify ( this . main . verticle , timeout ( 30000 ) . times ( 1 ) ) . start ( startPromise . capture ( ) ) ; startPromise . getValue ( ) . complete ( ) ; }
Should not store effective configuration.
Should not store effective configuration .