Getting Error oh hasEntry Example on Module 15 part 3 video | Rest Assured Training

Rest Assured Training Forum

Getting Error oh hasEntry Example on Module 15 part 3 video

M
Monal Post on 29/11/2019

Hi,

 So using hasEntry on giftOptions gives me below error:

given().get("/search").then().body("items[0].giftOptions", hasEntry("allowGiftWrap","false"));

 

java.lang.AssertionError: 1 expectation failed.

JSON path items[0].giftOptions doesn't match.

Expected: map containing ["allowGiftWrap"->"false"]

  Actual: {allowGiftReceipt=false, allowGiftWrap=false, allowGiftMessage=true}

There are more than one entries in giftOptions so how can we fix this ? 

need help see screen shot attached

M
Monal Reply on 29/11/2019

HI Sir

In your video you do not show the actual output of this example so its had to say did it passes or not, please update video or clarify the answer for hasEntery

Thank you