【发布时间】:2020-10-21 10:06:23
【问题描述】:
当我尝试匹配字符串列表时:
public void logHeaders(List<String> headers) {
then().body("headers", Matchers.contains(headers));
}
我明白了:
JSON path headers don't match.
Expected: iterable containing [<[Depth Top (m), Depth Base (m), Collector No., Sample No., Analysis Type, Age Range, Comments, Method, Sample Type]>]
Actual: [Depth Top (m), Depth Base (m), Collector No., Sample No., Analysis Type, Age Range, Comments, Method, Sample Type]
现在这对我来说似乎很匹配。我尝试了各种变体,似乎与许多问题和文章相匹配。我做错了什么?
JSON 看起来像:
{
"id": 14900,
"headers": [
"Depth Top (m)",
"Depth Base (m)",
"Collector No.",
"Sample No.",
"Analysis Type",
"Age Range",
"Comments",
"Method",
"Sample Type"
], etc
【问题讨论】:
标签: rest-assured hamcrest serenity-bdd