vertx/src/test/java/eu/internetofus/common/vertx/HttpResponses.java
/**
   * Verify that the body of the response is of the specified class type.
   *
   * @param <T>   type of the context,
   * @param clazz of the content.
   * @param res   response to get the body content.
   *
   * @return the content of the body.
   */
Verify that the body of the response is of the specified class type.
@param    type of the context,
@param clazz of the content.
@param res   response to get the body content.

@return the content of the body.
Verify that the body of the response is of the specified class type . @param type of the context @param clazz of the content . @param res response to get the body content . @return the content of the body .
static <T> T assertThatBodyIs(final Class<T> clazz, final HttpResponse<Buffer> res) {
    try {
      assertThat(res.getHeader(HttpHeaders.CONTENT_TYPE)).isEqualTo(MediaType.APPLICATION_JSON);
      return Json.decodeValue(res.body(), clazz);
    } catch (final Throwable throwable) {
      fail(throwable);
      return null;
    }
  }
static < T > T assertThatBodyIs ( final Class < T > clazz , final HttpResponse < Buffer > res ) { try { assertThat ( res . getHeader ( HttpHeaders . CONTENT_TYPE ) ) . isEqualTo ( MediaType . APPLICATION_JSON ) ; return Json . decodeValue ( res . body ( ) , clazz ) ; } catch ( final Throwable throwable ) { fail ( throwable ) ; return null ; } }
Verify that the body of the response is of the specified class type.
Verify that the body of the response is of the specified class type .