vertx/src/test/java/eu/internetofus/common/vertx/ComponentClientTest.java
/**
   * Obtain the service exception from the response.
   *
   * @param response to process.
   *
   * @see ComponentClient#toServiceException(io.vertx.ext.web.client.HttpResponse)
   */
Obtain the service exception from the response.
@param response to process.


Obtain the service exception from the response . @param response to process .
@Test
  public void shouldServiceExeption(@Mock final HttpResponse<Buffer> response) {
    final var service = new ComponentClient(null, null);
    final var code = 400;
    doReturn(code).when(response).statusCode();
    final var message = UUID.randomUUID().toString();
    doReturn(message).when(response).statusMessage();
    final var exception = service.toServiceException(response);
    assertThat(exception).isNotNull();
    assertThat(exception.failureCode()).isEqualTo(code);
    assertThat(exception.getMessage()).isEqualTo(message);
  }
@ Test public void shouldServiceExeption ( @ Mock final HttpResponse < Buffer > response ) { final var service = new ComponentClient ( null , null ) ; final var code = 400 ; doReturn ( code ) . when ( response ) . statusCode ( ) ; final var message = UUID . randomUUID ( ) . toString ( ) ; doReturn ( message ) . when ( response ) . statusMessage ( ) ; final var exception = service . toServiceException ( response ) ; assertThat ( exception ) . isNotNull ( ) ; assertThat ( exception . failureCode ( ) ) . isEqualTo ( code ) ; assertThat ( exception . getMessage ( ) ) . isEqualTo ( message ) ; }
Obtain the service exception from the response.
Obtain the service exception from the response .