vertx/src/test/java/eu/internetofus/common/vertx/AbstractAPIVerticleIntegrationTestCase.java
/**
   * Verify that return a not found error.
   *
   * @param client      to connect to the server.
   * @param testContext context to test.
   */
Verify that return a not found error.
@param client      to connect to the server.
@param testContext context to test.
Verify that return a not found error . @param client to connect to the server . @param testContext context to test .
@Test
  public void shouldReturnNotFoundErrorMessage(final WebClient client, final VertxTestContext testContext) {
    final var undefinedPath = "/undefinedPath";
    testRequest(client, HttpMethod.GET, undefinedPath).expect(res -> {
      assertThat(res.statusCode()).isEqualTo(Status.NOT_FOUND.getStatusCode());
      final var error = HttpResponses.assertThatBodyIs(ErrorMessage.class, res);
      assertThat(error.code).isEqualTo("not_found_api_request_path");
      assertThat(error.message).isNotEmpty().isNotEqualTo(error.code).contains(undefinedPath);
    }).send(testContext);
  }
@ Test public void shouldReturnNotFoundErrorMessage ( final WebClient client , final VertxTestContext testContext ) { final var undefinedPath = "/undefinedPath" ; testRequest ( client , HttpMethod . GET , undefinedPath ) . expect ( res -> { assertThat ( res . statusCode ( ) ) . isEqualTo ( Status . NOT_FOUND . getStatusCode ( ) ) ; final var error = HttpResponses . assertThatBodyIs ( ErrorMessage . class , res ) ; assertThat ( error . code ) . isEqualTo ( "not_found_api_request_path" ) ; assertThat ( error . message ) . isNotEmpty ( ) . isNotEqualTo ( error . code ) . contains ( undefinedPath ) ; } ) . send ( testContext ) ; }
Verify that return a not found error.
Verify that return a not found error .