vertx/src/test/java/eu/internetofus/common/vertx/basic/BadRequestHandlerIT.java
/**
   * Should not create a user when the body is not valid.
   *
   * @param client      to connect to the server.
   * @param testContext context to test.
   */
Should not create a user when the body is not valid.
@param client      to connect to the server.
@param testContext context to test.
Should not create a user when the body is not valid . @param client to connect to the server . @param testContext context to test .
@Test
  public void shouldInformAboutBadParameterWhenGetUsersPage(final WebClient client,
      final VertxTestContext testContext) {
    testRequest(client, HttpMethod.GET, Users.PATH).with(queryParam("limit", "hundred")).expect(res -> {
      assertThat(res.statusCode()).isEqualTo(Status.BAD_REQUEST.getStatusCode());
      final var error = assertThatBodyIs(ErrorMessage.class, res);
      assertThat(error.code).isEqualTo("bad_parameter_limit");
      assertThat(error.message).contains("NumberFormatException");
    }).send(testContext);
  }
@ Test public void shouldInformAboutBadParameterWhenGetUsersPage ( final WebClient client , final VertxTestContext testContext ) { testRequest ( client , HttpMethod . GET , Users . PATH ) . with ( queryParam ( "limit" , "hundred" ) ) . expect ( res -> { assertThat ( res . statusCode ( ) ) . isEqualTo ( Status . BAD_REQUEST . getStatusCode ( ) ) ; final var error = assertThatBodyIs ( ErrorMessage . class , res ) ; assertThat ( error . code ) . isEqualTo ( "bad_parameter_limit" ) ; assertThat ( error . message ) . contains ( "NumberFormatException" ) ; } ) . send ( testContext ) ; }
Should not create a user when the body is not valid.
Should not create a user when the body is not valid .