Date.Format failing after upgrading ReadyAPI to version 3.3.1
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 */
"import groovy.time.TimeCategory
def now = new Date()
log.info now.format("YYYY-MM-dd HH:mm:ss")"
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
Nice one,
Rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
apologies - unsure what happened - I certainly didn't edit the link when I copied it
ta
rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recommend using java.time.LocalDate class
https://howtodoinjava.com/java/date-time/java-time-localdate-class/
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works as well
"def lastUpdatedDateTimeUTC = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(lastUpdateDate)"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
