dummy/src/test/java/eu/internetofus/wenet_dummy/api/echo/EchoIT.java
/**
   * Should patch.
   *
   * @param vertx       that contains the event bus to use.
   * @param client      to use.
   * @param testContext context over the tests.
   */
Should patch.
@param vertx       that contains the event bus to use.
@param client      to use.
@param testContext context over the tests.
Should patch . @param vertx that contains the event bus to use . @param client to use . @param testContext context over the tests .
@Test
  public void shouldPatch(final Vertx vertx, final WebClient client, final VertxTestContext testContext) {
    final var model = new JsonObject().put("key", "value").putNull("nullField").put("emptyField", new JsonArray()).put(
        "child", new JsonObject().put("child", "1").putNull("nullChildField").put("emptyChildField", new JsonArray()));
    testRequest(client, HttpMethod.PATCH, Echo.PATH).expect(res -> {
      assertThat(res.statusCode()).isEqualTo(Status.OK.getStatusCode());
      final var patched = res.bodyAsJsonObject();
      assertThat(patched).isNotNull().isEqualTo(model);
      assertThat(patched.fieldNames()).isEqualTo(model.fieldNames());
      assertThat(patched.getJsonObject("child").fieldNames()).isEqualTo(model.getJsonObject("child").fieldNames());
    }).sendJson(model, testContext);
  }
@ Test public void shouldPatch ( final Vertx vertx , final WebClient client , final VertxTestContext testContext ) { final var model = new JsonObject ( ) . put ( "key" , "value" ) . putNull ( "nullField" ) . put ( "emptyField" , new JsonArray ( ) ) . put ( "child" , new JsonObject ( ) . put ( "child" , "1" ) . putNull ( "nullChildField" ) . put ( "emptyChildField" , new JsonArray ( ) ) ) ; testRequest ( client , HttpMethod . PATCH , Echo . PATH ) . expect ( res -> { assertThat ( res . statusCode ( ) ) . isEqualTo ( Status . OK . getStatusCode ( ) ) ; final var patched = res . bodyAsJsonObject ( ) ; assertThat ( patched ) . isNotNull ( ) . isEqualTo ( model ) ; assertThat ( patched . fieldNames ( ) ) . isEqualTo ( model . fieldNames ( ) ) ; assertThat ( patched . getJsonObject ( "child" ) . fieldNames ( ) ) . isEqualTo ( model . getJsonObject ( "child" ) . fieldNames ( ) ) ; } ) . sendJson ( model , testContext ) ; }
Should patch.
Should patch .