components/src/test/java/eu/internetofus/common/components/service/WeNetServiceSimulatorMocker.java
/**
   * Handler for a {@link DataElement}.
   *
   * @param handler to convert.
   *
   * @return the handler to manage an element.
   */
Handler for a  DataElement.
@param handler to convert.

@return the handler to manage an element.
Handler for a DataElement . @param handler to convert . @return the handler to manage an element .
protected Handler<RoutingContext> toRoutingContextHandler(final DataElementHandler handler) {
    return ctx -> {
      final var id = ctx.pathParam("id");
      final var index = this.indexOf(id);
      if (index < 0) {
        final var response = ctx.response();
        response.setStatusCode(Status.NOT_FOUND.getStatusCode());
        response.end(new ErrorMessage("undefined_app", "The application does not exist").toBuffer());
      } else {
        handler.handle(ctx, index);
      }
    };
  }
protected Handler < RoutingContext > toRoutingContextHandler ( final DataElementHandler handler ) { return ctx -> { final var id = ctx . pathParam ( "id" ) ; final var index = this . indexOf ( id ) ; if ( index < 0 ) { final var response = ctx . response ( ) ; response . setStatusCode ( Status . NOT_FOUND . getStatusCode ( ) ) ; response . end ( new ErrorMessage ( "undefined_app" , "The application does not exist" ) . toBuffer ( ) ) ; } else { handler . handle ( ctx , index ) ; } } ; }
Handler for a {@link DataElement}.
Handler for a { @link DataElement } .