接口返回有些字段每次都是动态变化,只校验不变的字段应该怎么做?Rest-Assured 原生支持吗?还是说要自己写?
假设接口返回如下:
{
"lotto":{
"lottoId":5,
"winning-numbers":[2,45,34,23,7,5,3],
"winners":[{
"winnerId":23,
"numbers":[2,45,34,23,3,5]
},{
"winnerId":54,
"numbers":[52,3,12,11,18,22]
}],
"updateTime":"2019-03-04 01:22:22"
}
}
而updateTime
,winnerId
每次请求都是变化的,想忽略掉,只检查如下内容:
{
"lotto":{
"lottoId":5,
"winning-numbers":[2,45,34,23,7,5,3],
"winners":[{
"numbers":[2,45,34,23,3,5]
},{
"numbers":[52,3,12,11,18,22]
}],
}
}