Class HttpGlueCode

java.lang.Object
de.gematik.test.tiger.glue.HttpGlueCode

public class HttpGlueCode extends Object
  • Constructor Details

    • HttpGlueCode

      public HttpGlueCode()
  • Method Details

    • requestType

      public io.restassured.http.Method requestType(String name)
      Parameters:
      name - name of the HTTP request method
      Returns:
      an actual Method
    • sendEmptyRequest

      @When("TGR send empty {requestType} request to {string}") @When("TGR eine leere {requestType} Anfrage an {string} sendet") @Then("TGR sende eine leere {requestType} Anfrage an {string}") public void sendEmptyRequest(io.restassured.http.Method method, String address)
      Sends an empty request via the selected method. Placeholders in address will be resolved.
      Parameters:
      method - HTTP request method (see Method)
      address - target address
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendEmptyRequestNonBlocking

      @When("TGR send empty {requestType} request to {string} without waiting for the response") @Then("TGR sende eine leere {requestType} Anfrage an {string} ohne auf Antwort zu warten") public void sendEmptyRequestNonBlocking(io.restassured.http.Method method, String address)
      Sends an empty request via the selected method. Placeholders in address will be resolved.

      This method is NON-BLOCKING, meaning it will not wait for the response before continuing the test.

      Parameters:
      method - HTTP request method (see Method)
      address - target address
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendEmptyRequestWithHeaders

      @When("TGR send empty {requestType} request to {string} with headers:") @When("TGR eine leere {requestType} Anfrage an {string} und den folgenden Headern sendet:") @Then("TGR sende eine leere {requestType} Anfrage an {string} mit folgenden Headern:") public void sendEmptyRequestWithHeaders(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable customHeaders)
      Sends an empty request via the selected method and expands the list of default headers with the headers provided by the caller. Placeholders in address and in the data table will be resolved. Example:
           When TGR send empty GET request to "${myAddress}" with headers:
            | name | bob |
            | age  | 27  |
       
      This will add two headers (name and age) with the respective values "bob" and "27" on top of the headers which are used by default.
      Parameters:
      method - HTTP request method (see Method)
      address - target address
      customHeaders - Markdown table of custom headers and their values
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendEmptyRequestWithHeadersNonBlocking

      @When("TGR send empty {requestType} request to {string} without waiting for the response with headers:") @Then("TGR sende eine leere {requestType} Anfrage an {string} ohne auf Antwort zu warten mit folgenden Headern:") public void sendEmptyRequestWithHeadersNonBlocking(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable customHeaders)
      Sends an empty request via the selected method and expands the list of default headers with the headers provided by the caller. Placeholders in address and in the data table will be resolved.

      This method is NON-BLOCKING, meaning it will not wait for the response before continuing the test.

      Parameters:
      method - HTTP request method (see Method)
      address - target address
      customHeaders - Markdown table of custom headers and their values
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendRequestWithBody

      @When("TGR send {requestType} request to {string} with body {string}") @When("TGR eine leere {requestType} Anfrage an {string} und dem folgenden body {string} sendet") @Then("TGR sende eine {requestType} Anfrage an {string} mit Body {string}") public void sendRequestWithBody(io.restassured.http.Method method, String address, String body)
      Sends a request containing the provided body via the selected method. Placeholders in the body and in address will be resolved.
      Parameters:
      method - HTTP request method (see Method)
      body - to be included in the request
      address - target address
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendRequestWithBodyNonBlocking

      @When("TGR send {requestType} request to {string} with body {string} without waiting for the response") @Then("TGR sende eine {requestType} Anfrage an {string} mit Body {string} ohne auf Antwort zu warten") public void sendRequestWithBodyNonBlocking(io.restassured.http.Method method, String address, String body)
      Sends a request containing the provided body via the selected method. Placeholders in the body and in address will be resolved.

      This method is NON-BLOCKING, meaning it will not wait for the response before continuing the test. ======= givenDefaultSpec() .body(resolve(body)) .request(method, new URI(resolveToString(address))); } /** Expands the list of default headers with the provided key-value pair. If the key already exists, then the existing value is overwritten by the new value. Placeholders in the header name and in its value will be resolved. >>>>>>> master

      Parameters:
      method - HTTP request method (see Method)
      body - to be included in the request
      address - target address
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendRequestWithParams

      @When("TGR send {requestType} request to {string} with:") @When("TGR eine {requestType} Anfrage an {string} mit den folgenden Daten sendet:") @Then("TGR sende eine {requestType} Anfrage an {string} mit folgenden Daten:") public void sendRequestWithParams(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable parameters)
      Sends a request via the selected method. The request is expanded by the provided key-value pairs. Placeholders in keys and values will be resolved. Example:
            When Send POST request to "http://my.address.com" with
             | ${configured_param_name}   | state                     | redirect_uri        |
             | client_id                  | ${configured_state_value} | https://my.redirect |
       

      NOTE: This Markdown table must contain exactly 1 row of headers and 1 row of values.

      Parameters:
      method - HTTP request method (see Method)
      address - target address
      parameters - to be sent with the request
      See Also:
      • RequestSpecification.formParams(Map)
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • sendRequestWithParamsNonBlocking

      @When("TGR send {requestType} request to {string} without waiting for the response with:") @Then("TGR sende eine {requestType} Anfrage an {string} ohne auf Antwort zu warten mit folgenden Daten:") public void sendRequestWithParamsNonBlocking(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable parameters)
      Sends a request via the selected method. The request is expanded by the provided key-value pairs. Placeholders in keys and values will be resolved.

      This method is NON-BLOCKING, meaning it will not wait for the response before continuing the test.

      Parameters:
      method - HTTP request method (see Method)
      address - target address
      parameters - to be sent with the request
      See Also:
      • RequestSpecification.formParams(Map)
      • TigerGlobalConfiguration.resolvePlaceholders(String)
    • setDefaultHeader

      @When("TGR set default header {string} to {string}") @When("TGR den default header {string} auf den Wert {string} setzen") @Then("TGR setze den default header {string} auf den Wert {string}") public void setDefaultHeader(String header, String value)
      Expands the list of default headers with the provided key-value pair. If the key already exists, then the existing value is overwritten by the new value. Placeholders in the header name and in its value will be resolved.
      Parameters:
      header - key
      value - to be stored under the given key
      See Also:
      • TigerGlobalConfiguration.resolvePlaceholders(String)