vertx/src/test/java/eu/internetofus/common/vertx/AbstractMainTest.java
/**
   * Verify can not start server because exist bad configuration files.
   *
   * @param testContext test context over the event bus.
   * @param stream      captured system err stream.
   * @param tmpDir      temporal directory.
   *
   *
   * @throws Throwable if can not create temporal files.
   */
Verify can not start server because exist bad configuration files.
@param testContext test context over the event bus.
@param stream      captured system err stream.
@param tmpDir      temporal directory.

@throws Throwable if can not create temporal files.
Verify can not start server because exist bad configuration files . @param testContext test context over the event bus . @param stream captured system err stream . @param tmpDir temporal directory . @throws Throwable if can not create temporal files .
@Test
  @ExtendWith(SystemErrGuard.class)
  public void shouldNotStartServerBecauseConfigurationFilesAreWrong(final VertxTestContext testContext,
      final Capturable stream, @TempDir final File tmpDir) throws Throwable {
    final var confDir = new File(tmpDir, "etc");
    confDir.mkdirs();
    new File(confDir, "Z").mkdirs();
    final var unreadable = new File(confDir, "x.json");
    unreadable.createNewFile();
    unreadable.setReadable(false);
    Files.writeString(new File(confDir, "bad_yaml.yml").toPath(), "{\"api\":{\"port\":0}}");
    Files.writeString(new File(confDir, "bad_json.json").toPath(), "port:0");
    this.assertNotStartWith(testContext, "-" + AbstractMain.CONF_DIR_OPTION, confDir.getAbsolutePath());
  }
@ Test @ ExtendWith ( SystemErrGuard . class ) public void shouldNotStartServerBecauseConfigurationFilesAreWrong ( final VertxTestContext testContext , final Capturable stream , @ TempDir final File tmpDir ) throws Throwable { final var confDir = new File ( tmpDir , "etc" ) ; confDir . mkdirs ( ) ; new File ( confDir , "Z" ) . mkdirs ( ) ; final var unreadable = new File ( confDir , "x.json" ) ; unreadable . createNewFile ( ) ; unreadable . setReadable ( false ) ; Files . writeString ( new File ( confDir , "bad_yaml.yml" ) . toPath ( ) , "{\"api\":{\"port\":0}}" ) ; Files . writeString ( new File ( confDir , "bad_json.json" ) . toPath ( ) , "port:0" ) ; this . assertNotStartWith ( testContext , "-" + AbstractMain . CONF_DIR_OPTION , confDir . getAbsolutePath ( ) ) ; }
Verify can not start server because exist bad configuration files.
Verify can not start server because exist bad configuration files .