vertx/src/test/java/eu/internetofus/common/vertx/ServiceResponseHandlersTest.java
/**
   * Check the response with an error message without an exception.
   *
   * @param testContext context that executes the test.
   */
Check the response with an error message without an exception.
@param testContext context that executes the test.
Check the response with an error message without an exception . @param testContext context that executes the test .
@Test
  public void shouldResponseFailedWithNullException(final VertxTestContext testContext) {
    ServiceResponseHandlers.responseFailedWith(testContext.succeeding(reponse -> testContext.verify(() -> {
      assertThat(reponse.getStatusCode()).isEqualTo(Status.NOT_FOUND.getStatusCode());
      assertThat(reponse.getHeaders().get(HttpHeaders.CONTENT_TYPE)).isEqualTo(MediaType.APPLICATION_JSON);
      assertThat(reponse.getPayload().toString())
          .isEqualTo("{\"code\":\"undefined\",\"message\":\"Unexpected failure\"}");
      testContext.completeNow();
    })), Status.NOT_FOUND, null);
  }
@ Test public void shouldResponseFailedWithNullException ( final VertxTestContext testContext ) { ServiceResponseHandlers . responseFailedWith ( testContext . succeeding ( reponse -> testContext . verify ( ( ) -> { assertThat ( reponse . getStatusCode ( ) ) . isEqualTo ( Status . NOT_FOUND . getStatusCode ( ) ) ; assertThat ( reponse . getHeaders ( ) . get ( HttpHeaders . CONTENT_TYPE ) ) . isEqualTo ( MediaType . APPLICATION_JSON ) ; assertThat ( reponse . getPayload ( ) . toString ( ) ) . isEqualTo ( "{\"code\":\"undefined\",\"message\":\"Unexpected failure\"}" ) ; testContext . completeNow ( ) ; } ) ) , Status . NOT_FOUND , null ) ; }
Check the response with an error message without an exception.
Check the response with an error message without an exception .