vertx/src/test/java/eu/internetofus/common/vertx/AbstractModelResourcesIT.java
/**
   * Should not create a model that is invalid.
   *
   * @param vertx       event bus to use.
   * @param client      to connect to the server.
   * @param testContext context to test.
   */
Should not create a model that is invalid.
@param vertx       event bus to use.
@param client      to connect to the server.
@param testContext context to test.
Should not create a model that is invalid . @param vertx event bus to use . @param client to connect to the server . @param testContext context to test .
@Test
  public void shouldCreateModel(final Vertx vertx, final WebClient client, final VertxTestContext testContext) {
    testContext.assertComplete(this.createValidModelExample(1, vertx, testContext)).onSuccess(source -> {
      testRequest(client, HttpMethod.POST, this.modelPath()).expect(res -> {
        assertThat(res.statusCode()).isEqualTo(Status.CREATED.getStatusCode());
        @SuppressWarnings("unchecked")
        final var target = (T) assertThatBodyIs(source.getClass(), res);
        this.assertThatCreatedEquals(source, target);
      }).sendJson(source.toJsonObject(), testContext);
    });
  }
@ Test public void shouldCreateModel ( final Vertx vertx , final WebClient client , final VertxTestContext testContext ) { testContext . assertComplete ( this . createValidModelExample ( 1 , vertx , testContext ) ) . onSuccess ( source -> { testRequest ( client , HttpMethod . POST , this . modelPath ( ) ) . expect ( res -> { assertThat ( res . statusCode ( ) ) . isEqualTo ( Status . CREATED . getStatusCode ( ) ) ; @ SuppressWarnings ( "unchecked" ) final var target = ( T ) assertThatBodyIs ( source . getClass ( ) , res ) ; this . assertThatCreatedEquals ( source , target ) ; } ) . sendJson ( source . toJsonObject ( ) , testContext ) ; } ) ; }
Should not create a model that is invalid.
Should not create a model that is invalid .