vertx/src/test/java/eu/internetofus/common/vertx/OpenAPIValidatorTest.java
/**
   * Check that a future fails.
   *
   * @param future      that has to fail.
   * @param codePrefix  expected error prefix.
   * @param testContext test cycle controller.
   */
Check that a future fails.
@param future      that has to fail.
@param codePrefix  expected error prefix.
@param testContext test cycle controller.
Check that a future fails . @param future that has to fail . @param codePrefix expected error prefix . @param testContext test cycle controller .
public static final <T> void assertFail(final Future<T> future, final String codePrefix,
      final VertxTestContext testContext) {
    future.onComplete(testContext.failing(error -> testContext.verify(() -> {
      assertThat(error).isInstanceOf(ValidationErrorException.class);
      final var code = ((ValidationErrorException) error).getCode();
      var expectedErrorCode = ROOT;
      if (codePrefix != null) {
        if (!codePrefix.startsWith("[")) {
          expectedErrorCode += ".";
        }
        expectedErrorCode += codePrefix;
      }
      assertThat(code).isEqualTo(expectedErrorCode);
      testContext.completeNow();
    })));
  }
public static final < T > void assertFail ( final Future < T > future , final String codePrefix , final VertxTestContext testContext ) { future . onComplete ( testContext . failing ( error -> testContext . verify ( ( ) -> { assertThat ( error ) . isInstanceOf ( ValidationErrorException . class ) ; final var code = ( ( ValidationErrorException ) error ) . getCode ( ) ; var expectedErrorCode = ROOT ; if ( codePrefix != null ) { if ( ! codePrefix . startsWith ( "[" ) ) { expectedErrorCode += "." ; } expectedErrorCode += codePrefix ; } assertThat ( code ) . isEqualTo ( expectedErrorCode ) ; testContext . completeNow ( ) ; } ) ) ) ; }
Check that a future fails.
Check that a future fails .