class HttpRequestBuilder(commonAttributes: CommonAttributes, val httpAttributes: HttpAttributes) extends RequestBuilder[HttpRequestBuilder](commonAttributes) {
...
def check(checks: HttpCheck*): HttpRequestBuilder = newInstance(httpAttributes.copy(checks = httpAttributes.checks ::: checks.toList))
...
}
class MyHttpCheck(wrapped: Check[Response], scope: HttpCheckScope, responseBodyUsageStrategy: Option[ResponseBodyUsageStrategy]) extends HttpCheck {
override def check(response: Response, session: Session): Validation[CheckResult] = {
// custom check code
return new Success(response) // or new Failure(response)
}
}
.http(requestTitle).post("/url").body(body).check(status.is(200), , new HttpCheck())
.exec(http(requestTitle).post(url).body(body).check(status.is(200), bodyBytes.saveAs("response"))
.exec(session => {
val response = session("response")
// Assert on the response stored on the response; Throw an exception to abort the session if necessary.
// Return the (potentially updated) session object
session
})
.exec(http(requestTitle).post(url).body(body).check(status.is(200), bodyBytes.saveAs("response"))
--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.