vertx/src/test/java/eu/internetofus/common/vertx/ComponentClientAsserts.java
/**
   * Assert that the client call fails with an HTTP status error and an
   * {@code ErrorMessage} as content.
   *
   * @param future      that has to fail.
   * @param testContext context of the test.
   * @param status      expected status error.
   *
   * @return the future error message for the HTTP failure.
   */
Assert that the client call fails with an HTTP status error and an
ErrorMessage as content.

@param future      that has to fail.
@param testContext context of the test.
@param status      expected status error.

@return the future error message for the HTTP failure.
Assert that the client call fails with an HTTP status error and an ErrorMessage as content . @param future that has to fail . @param testContext context of the test . @param status expected status error . @return the future error message for the HTTP failure .
static Future<ErrorMessage> assertStatusError(final Future<?> future, final VertxTestContext testContext,
      final Status status) {
    final Promise<ErrorMessage> promise = Promise.promise();
    testContext.assertFailure(future).onFailure(error ->
    testContext.verify(() -> {
      assertThat(error).isExactlyInstanceOf(ServiceException.class);
      final var serviceError = (ServiceException) error;
      assertThat(serviceError.failureCode()).isEqualTo(status.getStatusCode());
      final var errorMsg = Model.fromJsonObject(serviceError.getDebugInfo(), ErrorMessage.class);
      assertThat(errorMsg).isNotNull();
      promise.complete(errorMsg);
    }));
    return promise.future();
  }
static Future < ErrorMessage > assertStatusError ( final Future < ? > future , final VertxTestContext testContext , final Status status ) { final Promise < ErrorMessage > promise = Promise . promise ( ) ; testContext . assertFailure ( future ) . onFailure ( error -> testContext . verify ( ( ) -> { assertThat ( error ) . isExactlyInstanceOf ( ServiceException . class ) ; final var serviceError = ( ServiceException ) error ; assertThat ( serviceError . failureCode ( ) ) . isEqualTo ( status . getStatusCode ( ) ) ; final var errorMsg = Model . fromJsonObject ( serviceError . getDebugInfo ( ) , ErrorMessage . class ) ; assertThat ( errorMsg ) . isNotNull ( ) ; promise . complete ( errorMsg ) ; } ) ) ; return promise . future ( ) ; }
Assert that the client call fails with an HTTP status error and an
 {@code ErrorMessage} as content.
Assert that the client call fails with an HTTP status error and an { @code ErrorMessage } as content .