Class HttpGlueCode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.restassured.http.MethodrequestType(String name) voidsendEmptyRequest(io.restassured.http.Method method, String address) Sends an empty request via the selected method.voidsendEmptyRequestNonBlocking(io.restassured.http.Method method, String address) Sends an empty request via the selected method.voidsendEmptyRequestWithHeaders(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.voidsendEmptyRequestWithHeadersNonBlocking(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.voidsendRequestWithBody(io.restassured.http.Method method, String address, String body) Sends a request containing the provided body via the selected method.voidsendRequestWithBodyNonBlocking(io.restassured.http.Method method, String address, String body) Sends a request containing the provided body via the selected method.voidsendRequestWithParams(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable parameters) Sends a request via the selected method.voidsendRequestWithParamsNonBlocking(io.restassured.http.Method method, String address, io.cucumber.datatable.DataTable parameters) Sends a request via the selected method.voidsetDefaultHeader(String header, String value) Expands the list of default headers with the provided key-value pair.
-
Constructor Details
-
HttpGlueCode
public HttpGlueCode()
-
-
Method Details
-
requestType
- 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 (seeMethod)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 (seeMethod)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 (seeMethod)address- target addresscustomHeaders- 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 (seeMethod)address- target addresscustomHeaders- 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 (seeMethod)body- to be included in the requestaddress- 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 (seeMethod)body- to be included in the requestaddress- 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 (seeMethod)address- target addressparameters- 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 (seeMethod)address- target addressparameters- 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- keyvalue- to be stored under the given key- See Also:
-
TigerGlobalConfiguration.resolvePlaceholders(String)
-