vertx/src/test/java/eu/internetofus/common/vertx/ComponentClientTest.java
/**
   * Check that create a handler that can manage success without content response.
   *
   * @param response    to process.
   * @param testContext context that manage the test.
   *
   * @see ComponentClient#createHandlerWithAnyBodyAndSuccessResponse(io.vertx.core.Promise,
   *      String)
   */
Check that create a handler that can manage success without content response.
@param response    to process.
@param testContext context that manage the test.


Check that create a handler that can manage success without content response . @param response to process . @param testContext context that manage the test .
@Test
  public void shouldHandleWithoutBodyAndSuccessReponse(@Mock final HttpResponse<Buffer> response,
      final VertxTestContext testContext) {
    final var service = new ComponentClient(null, null);
    doReturn(Status.NO_CONTENT.getStatusCode()).when(response).statusCode();
    final Promise<Model> promise = Promise.promise();
    service.createHandlerWithAnyBodyAndSuccessResponse(promise, "actionId").handle(response);
    promise.future().onComplete(testContext.succeeding(content -> testContext.verify(() -> {
      assertThat(content).isNull();
      testContext.completeNow();
    })));
  }
@ Test public void shouldHandleWithoutBodyAndSuccessReponse ( @ Mock final HttpResponse < Buffer > response , final VertxTestContext testContext ) { final var service = new ComponentClient ( null , null ) ; doReturn ( Status . NO_CONTENT . getStatusCode ( ) ) . when ( response ) . statusCode ( ) ; final Promise < Model > promise = Promise . promise ( ) ; service . createHandlerWithAnyBodyAndSuccessResponse ( promise , "actionId" ) . handle ( response ) ; promise . future ( ) . onComplete ( testContext . succeeding ( content -> testContext . verify ( ( ) -> { assertThat ( content ) . isNull ( ) ; testContext . completeNow ( ) ; } ) ) ) ; }
Check that create a handler that can manage success without content response.
Check that create a handler that can manage success without content response .