Date.Format failing after upgrading ReadyAPI to version 3.3.1
After upgrading ReadyAPI to 3.3.1 from 3.3.0 the following Groovy script started failing with error "No signature of method: java.util.Date.format() is applicable for argument types: (String) values: [YYYY-MM-dd HH:mm:ss]". It dosen't like the .format of the date. Has the Groovy version got upgraded in version 3.3.1. Is there a quick solution for this issue?
/*Assertion Groovy Script */
def now = new Date()
log.info now.format("YYYY-MM-dd HH:mm:ss")"
Solved! Go to Solution.
A number of people have found problems with their date handling in the latest version.
@nmrao suggested a possible fix for this in https://community.smartbear.com/t5/SoapUI-Pro/ReadyAPI-3-3-1-is-not-understanding-my-code-to-add-day...
Have a look and see if that sorts it,
apologies - unsure what happened - I certainly didn't edit the link when I copied it
I recommend using java.time.LocalDate class
This works as well
"def lastUpdatedDateTimeUTC = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(lastUpdateDate)"