vertx/src/test/java/eu/internetofus/common/vertx/AbstractModelResourcesIT.java
/**
   * Should not create a model that is invalid.
   *
   * @param client      to connect to the server.
   * @param testContext context to test.
   */
Should not create a model that is invalid.
@param client      to connect to the server.
@param testContext context to test.
Should not create a model that is invalid . @param client to connect to the server . @param testContext context to test .
@Test
  public void shouldNotCreateInvalidModel(final WebClient client, final VertxTestContext testContext) {
    testRequest(client, HttpMethod.POST, this.modelPath()).expect(res -> {
      assertThat(res.statusCode()).isEqualTo(Status.BAD_REQUEST.getStatusCode());
      final var error = assertThatBodyIs(ErrorMessage.class, res);
      assertThat(error.code).isNotEmpty();
      assertThat(error.message).isNotEmpty().isNotEqualTo(error.code);
    }).sendJson(this.createInvalidModel().toJsonObject(), testContext);
  }
@ Test public void shouldNotCreateInvalidModel ( final WebClient client , final VertxTestContext testContext ) { testRequest ( client , HttpMethod . POST , this . modelPath ( ) ) . expect ( res -> { assertThat ( res . statusCode ( ) ) . isEqualTo ( Status . BAD_REQUEST . getStatusCode ( ) ) ; final var error = assertThatBodyIs ( ErrorMessage . class , res ) ; assertThat ( error . code ) . isNotEmpty ( ) ; assertThat ( error . message ) . isNotEmpty ( ) . isNotEqualTo ( error . code ) ; } ) . sendJson ( this . createInvalidModel ( ) . toJsonObject ( ) , testContext ) ; }
Should not create a model that is invalid.
Should not create a model that is invalid .