Interface HttpRequestMessageBuilder<T>

Type Parameters:
T - The body type of the request

public interface HttpRequestMessageBuilder<T>
Utility interface to help with testing of Azure cloud functions.
Since:
1.0
  • Method Details

    • method

      HttpRequestMessageBuilder<T> method(com.microsoft.azure.functions.HttpMethod method)
      Sets the request method.
      Parameters:
      method - The request method
      Returns:
      This builder
    • uri

      Sets the request URI.
      Parameters:
      uri - The URI
      Returns:
      This builder
    • header

      HttpRequestMessageBuilder<T> header(String name, String value)
      Sets a request header.
      Parameters:
      name - The header
      value - The value
      Returns:
      The message builder
    • parameter

      HttpRequestMessageBuilder<T> parameter(String name, String value)
      Sets a request query parameter.
      Parameters:
      name - The name
      value - The value
      Returns:
      The builder
    • body

      <B> HttpRequestMessageBuilder<B> body(B body)
      Sets the request body.
      Type Parameters:
      B - The body type
      Parameters:
      body - The body
      Returns:
      This builder
    • build

      com.microsoft.azure.functions.HttpRequestMessage<T> build()
      Returns:
      Builds the message
    • buildEncoded

      com.microsoft.azure.functions.HttpRequestMessage<Optional<String>> buildEncoded()
      Returns:
      Builds the message
    • invoke

      com.microsoft.azure.functions.HttpResponseMessage invoke()
    • method

      default HttpRequestMessageBuilder<T> method(io.micronaut.http.HttpMethod method)
      Sets the request method.
      Parameters:
      method - The request method
      Returns:
      This builder
    • method

      default HttpRequestMessageBuilder<T> method(String method)
      Sets the request method.
      Parameters:
      method - The request method
      Returns:
      This builder
    • uri

      default HttpRequestMessageBuilder<T> uri(String uri)
      Sets the request URI.
      Parameters:
      uri - The URI
      Returns:
      This builder
    • builder

      static <T> HttpRequestMessageBuilder<T> builder(com.microsoft.azure.functions.HttpMethod method, String uri, @NonNull @NonNull io.micronaut.context.ApplicationContext applicationContext)
      Create a builder for the given application context.
      Type Parameters:
      T - The builder body type
      Parameters:
      method - The HTTP method
      uri - The URI
      applicationContext - The context
      Returns:
      The builder