khanchett
5 years agoContributor
Ready API 3.3.1 - messed date up
I just updated my SoapUI to 3.3.1 and now my Groovy dates don't work. I keep getting errors "groovy.lang.MissingMethodException: No signature of method: java.util.Date.format() ..." Has anyone else had this and do they have a fix? To recreate I have 2 different ways:
1. in a Groovy script: String todaysDate = new Date().format("YYYYMMdd")
2. in XML injection ${new Date().format("YYYYMMdd")}
Everything was running fine. I did the update, made no changes and now this doesn't work. I'm going back to 3.3.0 for now due to this is a complete stop for me.
I appreciate any help someone can provide.
Using Java 8 or more?
Please check the below:
log.info java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('yyyy-MM-dd'))
In xml
<!-- assuming date is element; change as you needed--> <date>${= java.time.LocalDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern('yyyy-MM-dd'))}</date>