Hi, I would like to know if there is a proper way to make a custom check on the request status ( like is / not / …)
atm,I want to check non-regression of an API and check as good if the older 500/400 status are still here or if it have disappear, i also want to consider every 200 status as good.
I’m also using a feeder to build my query and replay log.
I would like do to something “ideally” like this :
... .check(status.is("${status}") || !status.in(400 to 510)) ...
Use “in” and pass a function that would take the session as input, fetch the “status” attribute and return a Seq[Int] with the (100 to 510) range complete with this value.
def getGoodHttpStatus(session : Session): Seq[Int] ={
val list = new ListBuffer[Int]()
list ++= 200 to 230
list += session("status").as[Int]
list.toList
}
// like you did, assuming "status" is indeed an Int and not a String that
could be parsed into an Int
status.is(session => session("status").validate[Int]).map(status => (200 to
300).toSet + status))
Thank’s but I tryied your solution and it give me an error : expected HttpCheck, actual Validation[Int],
I don’t understand how to get over it. Have you any idea ?
Use a status.in() check, but pass a function instead of a value, where you would resolve the “status” attribute value and concatenate with the (400 to 510) range.