Hi,
I use the next scenario
`
def getPath(id: String): String = s"/content/prod${id}"
def getRequestBody(currentId: String): String = {
buildJson(currentId)
}
def getCheck(expected: String): HttpCheck =
bodyString.validate(_ => buildMatcher(expected))
val feeder = Iterator.continually(Map(“idR” → random))
scenario(“Test”)
.feed(feeder)
.exec(
http(“PUT ${idR}”)
.put(getPath("${idR}"))
.headers(headersJson)
.body(StringBody(getRequestBody("${idR}")))
.asJSON
.check(
status is 200
)
)
.pause(1 seconds)
.exec(
http(“GET ${idR}”)
.get(getPath("${idR}"))
.headers(headersJson)
.check(getCheck("${idR}")
)
}
`
with the custom functions for request body, url, checks. For body and url it works fine as the results are the strings, but for check it doesn’t work. I understand why(Warning This Expression Language only works on the final value that is passed to the DSL method when the Simulation is instantiated.) but I dont understand the way for use this with a custom validation function. Could you help me?
P.S. sorry for my english.