Forum Discussion

Karthik_K's avatar
Karthik_K
New Contributor
4 years ago
Solved

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")"

  • This works as well

    "def lastUpdatedDateTimeUTC =  new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(lastUpdateDate)"

6 Replies