Hello
Being new to Gatling and Scala, I am facing the following challenge.
I have a base class called ParameterizedSimulation which is being extended by all of my Simulations. Its goal is to provide some parameters to my tests coming from different places. The code is the following:
class ParameterizedSimulation extends Simulation {
// Workload model parameters
def injectionProfile: String = getProperty("INJECTION_PROFILE", "smoke")
...
private def getProperty(propertyName: String, defaultValue: String): String = {
Option(System.getenv(propertyName))
.orElse(Option(System.getProperty(propertyName)))
.getOrElse(defaultValue)
}
...
}
In addition to that, I have an object containing low-level methods (i.e. user actions) that I use in my Simulations. The code is like the following:
object UserAction {
...
def echo(): HttpRequestBuilder = {
http("Postman Echo Service Call")
.get("https://postman-echo.com/get")
.headers(headers("headers_0"))
}