【发布时间】:2016-08-12 05:41:17
【问题描述】:
我正在使用 JSON Payload 发出许多 HTTP 请求,并且我正在为每个请求读取一个文件以获取 JSON Payload,如下所示。
postPayload1 = val postPayload = ElFileBody("Test_case1.json")
val TC1 = feed(accountNumberFeeder1)
.exec(http(testCase1).post(appendPathToUrl).headers(common_header).body(postPayload).asJSON
.check(status.is(200)
)
但是,它现在在我的资源目录中变成了如此多的 JSON 文件。那么我可以将我所有的 JSON 合并到一个文件中,如下所示。
{"testCase1":{
"activationSource": "HH",
"accountStatus": null,
}
}
{"testCase2":{
"activationSource": "HH",
"accountStatus": null,
}
}
并使用我的密钥“testCase1”、“testCase2”等访问它?
val postPayload = ElFileBody("Test_case.json")
【问题讨论】:
标签: java scala scala-collections gatling