Gatling:检查二进制响应不为空

Gatling: check binary response not empty

我正在使用 Scala 对 Gatling 进行一些测试。我正在尝试检查返回的响应正文是否不为空。

我是这样做的:

def getImages: ChainBuilder = feed(credentials)
     .exec(http("Get Image")
     .get(GET_MY_URI)
     .queryParam("guid", "${branch}")
     .queryParam("t", "0.458654")
     .check(status.is(200))
     .check(bodyString.transform(_.size > 1).is(true)))

但它不起作用。我得到:

java.nio.charset.MalformedInputException: Input length = 1

有人知道如何实现我的目标吗?

替换

.check(bodyString.transform(_.size > 1).is(true))) 

.check(bodyBytes.exists)

这里解释了所有的DSL:https://gatling.io/docs/current/cheat-sheet/