Closed Dolly2315 closed 5 years ago
The problem is your matcher is incorrect:
Change this:
body: eachLike([{
'id': like(8061159),
'name': like('Country'),
'displayName': like('Country'),
'description': like(''),
'enabled': like(true),
'accountId': like(4),
'visibilityIds': eachLike([
4
]),
'userId': like(5),
'created': like('31 Jan 2018 11:56:48 +00:00'),
'lastModified': like('01 Feb 2018 11:58:49 +00:00')
}
])
to (note removed [
and ]
)
body: eachLike({
'id': like(8061159),
'name': like('Country'),
'displayName': like('Country'),
'description': like(''),
'enabled': like(true),
'accountId': like(4),
'visibilityIds': eachLike([
4
]),
'userId': like(5),
'created': like('31 Jan 2018 11:56:48 +00:00'),
'lastModified': like('01 Feb 2018 11:58:49 +00:00')
})
Also, you can avoid the like
statements within an eachLike
as it is implied by default. If you need to use a different matcher (e.g. a term
then go for it). So you can actually do this:
body: eachLike({
'id':8061159,
'name':'Country',
'displayName':'Country',
'description':'',
'enabled':true,
'accountId':4,
'visibilityIds': eachLike(4),
'userId':5,
'created':'31 Jan 2018 11:56:48 +00:00',
'lastModified':'01 Feb 2018 11:58:49 +00:00'
})
Thanks
At consumer level test is :
When i verify at provider level , I am getting the error as:
So it is again and again verifying the same one data of consumer ie id": 8061159 with the huge set of provider data .But in "$.body": { "min": 1 },
min array is already defined though