How to check Null Values in JSON Rest Assured

24 Views Asked by At

Here is the JSON response I am getting :

    {
        "total_due_amount": 0,
        "data": [
            {
                "id": 9,
                "open_amount": 0,
                "due_amount": 7250,
                "description": "New Product - TFN 1000 Min for 1 month at 3250 INR has been applied",
                "payment_status": 2,
                "due_date": "2018-07-23 00:00:00",
                "created_at": "2018-07-20 17:29:16",
                "updated_at": "2018-07-25 13:06:01"
            },
            {
                "id": 26,
                "open_amount": 0,
                "due_amount": 4750,
                "description": "New Product - TFN 500 Min for 1 month at 2599 INR has been applied",
                "payment_status": 2,
                "due_date": "2018-08-12 00:00:00",
                "created_at": "2018-08-09 15:01:05",
                "updated_at": "2018-08-09 15:54:39"
            }
 ]
 }

I need to verify that all the attributes I am getting in the JSON are not Null and has some value. What logic I should write in step definition?

0

There are 0 best solutions below