Class TigerHttpClient

java.lang.Object
de.gematik.test.tiger.lib.TigerHttpClient

public class TigerHttpClient extends Object
This class provides methods to send requests with RestAssured. It also provides methods to resolve placeholders in the request body and send the resolved body.
  • Field Details

  • Method Details

    • reset

      public static void reset()
    • givenDefaultSpec

      public static io.restassured.specification.RequestSpecification givenDefaultSpec()
      Create a configurable RequestSpecification with default Tiger headers. Example:
        givenDefaultSpec()
          .formParams(resolveMap(dataAsMaps.get(0), true))
          .headers(Map.of("header", "value"))
          .contentType(ContentType.JSON)
          .request(method, address));
       
      Returns:
      configurable RequestSpecification
    • executeCommandInBackground

      public static void executeCommandInBackground(org.assertj.core.api.SoftAssertionsProvider.ThrowingRunnable command)
      Execute a command in the background. This is useful for long-running tasks that should not block the main thread.
      Parameters:
      command - the command to execute
    • executeCommandWithContingentWait

      public static void executeCommandWithContingentWait(org.assertj.core.api.SoftAssertionsProvider.ThrowingRunnable command)
      Execute a command with a contingent wait. If the configuration value `executeBlocking` is set to `true`, the command is executed immediately. Otherwise, the command is executed in the background.
      Parameters:
      command - the command to execute
    • applyRedirectConfig

      public static void applyRedirectConfig(io.restassured.config.RedirectConfig newRedirectConfig)
      Apply a new RedirectConfig to the RestAssured configuration.
      Parameters:
      newRedirectConfig - the new RedirectConfig to apply
    • resetRedirectConfig

      public static void resetRedirectConfig()
      Reset the RedirectConfig to the default configuration.
    • resolveToString

      public static String resolveToString(String value)
      Resolve placeholders in the given value and return the result as a string.
      Parameters:
      value - the value to resolve
      Returns:
      the value, but resolved
    • resolve

      public static de.gematik.rbellogger.writer.RbelSerializationResult resolve(String value)
      Resolve placeholders in the given value and return the result as a byte array.
      Parameters:
      value - the value to resolve
      Returns:
      the value, but resolved as a byte array
    • sendResolvedBody

      public static void sendResolvedBody(io.restassured.http.Method method, URI address, String body)
      Send a request with the given method, address and body. The body is resolved before sending.
      Parameters:
      method - the HTTP method to use
      address - the URI to send the request to
      body - the body (which is to be resolved) of the request
    • sendResolvedBody

      public static void sendResolvedBody(io.restassured.http.Method method, URI address, String contentType, String body)
      Send a request with the given method, address and body. The body is resolved before sending.
      Parameters:
      method - the HTTP method to use
      address - the URI to send the request to
      contentType - the content type of the request
      body - the body (which is to be resolved) of the request