Forum Discussion

fazlook's avatar
fazlook
Frequent Contributor
8 years ago

What's the best scenario to compare UpdatedDate with a PUT REST request

I need to accomplish the following:

 

Send a first PUT request that creates something like :

 

{
"id": "1",
"name": "API",
"insertDate": "2016-12-22T15:52:40",
"updateDate": "2016-12-22T15:52:40"

}

 

Send another "SAME" PUT request to see if the updateDate will actually update

 

{
"id": "1",
"name": "API",
"insertDate": "2016-12-22T15:52:40",
"updateDate": "2016-12-22T15:52:50"

}

 

With nmrao help, I know how to use Script Assertion to Set properties values.

 

How do I compare those dates ? basically the updateDate in the second PUT should be > the original updateDate.

 

My own ideas are:

 

The insertDate/updateDate on the first PUT will be the same, but different on the Second PUT.....Can I use assertions to check my second PUT insert/update dates are different ?

 

Also, how do I check the date format did not change and it is YYYY-MM-DDThh:mm:ss

 

Thank you

No RepliesBe the first to reply