vertx/src/test/java/eu/internetofus/common/vertx/OpenAPIValidatorTest.java
/**
   * Load the arguments from some resource files.
   *
   * @param namePrefix       prefix for the files that contains the arguments.
   * @param argumentsBuilder the component that convert the loaded data to the
   *                         necessary arguments. The first argument is the test
   *                         identifier.
   *
   * @return the arguments to use.
   */
Load the arguments from some resource files.
@param namePrefix       prefix for the files that contains the arguments.
@param argumentsBuilder the component that convert the loaded data to the
necessary arguments. The first argument is the test
identifier.

@return the arguments to use.
Load the arguments from some resource files . @param namePrefix prefix for the files that contains the arguments . @param argumentsBuilder the component that convert the loaded data to the necessary arguments . The first argument is the test identifier . @return the arguments to use .
private static Stream<Arguments> loadArguments(final String namePrefix,
      final BiFunction<String, JsonObject, Arguments> argumentsBuilder) {
    final List<Arguments> arguments = new ArrayList<>();
    try {
      final var loader = OpenAPIValidatorTest.class.getClassLoader();
      final var name = "eu/internetofus/common/vertx/" + namePrefix + ".json";
      final var input = loader.getResourceAsStream(name);
      final var code = IOUtils.toString(input, Charset.defaultCharset());
      final var content = (JsonObject) Json.decodeValue(code);
      for (final var id : content.fieldNames()) {
        final var data = content.getJsonObject(id);
        arguments.add(argumentsBuilder.apply(id, data));
      }
    } catch (final Throwable cause) {
      fail("Cannot load file data, because " + cause);
    }
    return arguments.stream();
  }
private static Stream < Arguments > loadArguments ( final String namePrefix , final BiFunction < String , JsonObject , Arguments > argumentsBuilder ) { final List < Arguments > arguments = new ArrayList < > ( ) ; try { final var loader = OpenAPIValidatorTest . class . getClassLoader ( ) ; final var name = "eu/internetofus/common/vertx/" + namePrefix + ".json" ; final var input = loader . getResourceAsStream ( name ) ; final var code = IOUtils . toString ( input , Charset . defaultCharset ( ) ) ; final var content = ( JsonObject ) Json . decodeValue ( code ) ; for ( final var id : content . fieldNames ( ) ) { final var data = content . getJsonObject ( id ) ; arguments . add ( argumentsBuilder . apply ( id , data ) ) ; } } catch ( final Throwable cause ) { fail ( "Cannot load file data, because " + cause ) ; } return arguments . stream ( ) ; }
Load the arguments from some resource files.
Load the arguments from some resource files .
// can not load a file