components/src/test/java/eu/internetofus/common/components/AbstractComponentMocker.java
/**
   * Check the request has the required component apikey.
   *
   * @param ctx routing context to check the header.
   */
Check the request has the required component apikey.
@param ctx routing context to check the header.
Check the request has the required component apikey . @param ctx routing context to check the header .
protected void checkWeNetComponentApikey(final RoutingContext ctx) {
    final var apiKey = ctx.request().getHeader(AbstractServicesVerticle.WENET_COMPONENT_APIKEY_HEADER);
    if (Containers.DEFAULT_WENET_COMPONENT_APIKEY.equals(apiKey)) {
      ctx.next();
    } else {
      final var response = ctx.response();
      response.setStatusCode(Status.UNAUTHORIZED.getStatusCode());
      response.end(new ErrorMessage("bad_wenet_component_apikey", "Invalid authentication credentials").toBuffer());
    }
  }
protected void checkWeNetComponentApikey ( final RoutingContext ctx ) { final var apiKey = ctx . request ( ) . getHeader ( AbstractServicesVerticle . WENET_COMPONENT_APIKEY_HEADER ) ; if ( Containers . DEFAULT_WENET_COMPONENT_APIKEY . equals ( apiKey ) ) { ctx . next ( ) ; } else { final var response = ctx . response ( ) ; response . setStatusCode ( Status . UNAUTHORIZED . getStatusCode ( ) ) ; response . end ( new ErrorMessage ( "bad_wenet_component_apikey" , "Invalid authentication credentials" ) . toBuffer ( ) ) ; } }
Check the request has the required component apikey.
Check the request has the required component apikey .