dimanche 22 mars 2020

Comparison of extracted JSON value and String value in Rest Assured [duplicate]

I try to compare an extracted from JSON object value in String with special String value added manually. But condition isn't met.

List<String> CampaignIds = response.path("data.findAll {it.status.id} .status.id");
    for(String CampaignId: CampaignIds)
    {
        if(CampaignId == "1") ;
                else System.out.println("Campaign status is not 1 with campaignStatusId=1 query param");
    }

Here is an example of JSON I get

enter image description here

Aucun commentaire:

Enregistrer un commentaire