HTTP Steps

one step is defined here : givenHttpCall

This step comes as a parameterized function, the parameterized type is the expected return type for the HTTP Call.
Return type of step is HTTPResponse<EXPECTED_RESULT>

model

Parameters to provide on step

  • name: () → String? // optional, give a name to your step to make scenario execution more readable

  • url: String // mandatory

  • method: String // optional, default is GET

  • body: Any? // optional, default is null

  • headers: Map<String, String> // optional, default is empty this function can be used to pass result of step on another step

Sample

val stepResult = givenHttpCall<String> {

    url = "http://myapi/hello"
    method = "POST"
    headers["Authorization"] = "Basic aGVsbG86d29ybGQ="
    body = """
        {
            "who": "Darth Vader"
        }
    """
}