HTTP Request assertion predicated on parameters and injecting URL components
I was wondering if there was a way to create HTTP request test steps, but call them from a groovy script for example, and inject certain parts of the URL -- interupting the script on fail. For example, the domain, parameters, endpoint, etc. The idea behind this question (maybe I should be going about this another way) is to create re-usable HTTP requests as components in my scripts that do validation.
1. Test Step A is an HTTP request, with a collection of assertions: [Assertion A, Assertion B, Assertion C . . ] preloaded
2. Test Step B (perhaps in another test case) is a groovy script that wants to fire an HTTP request using Test Step A, but also inject certain parameters, so the following request is made,
3. Test Step C might want to change the domain,
Finally, I was wondering if there was a feature that would populate assertions only if a given parameter or combination of parameters were present.