Ask a Question

Date.Format failing after upgrading ReadyAPI to version 3.3.1

SOLVED
Karthik_K
New Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Karthik_K
New Contributor

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

This works as well

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

View solution in original post

6 REPLIES 6
richie
Community Hero

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

Hey @Karthik_K

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
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
VishKini
Occasional Contributor

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

@richie : The above link is not working. Can you paste it again please?

richie
Community Hero

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

apologies - unsure what happened - I certainly didn't edit the link when I copied it

 

 

https://community.smartbear.com/t5/SoapUI-Pro/ReadyAPI-3-3-1-is-not-understanding-my-code-to-add-day...

 

ta

 

rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
tsuarezc
Occasional Contributor

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

I recommend using java.time.LocalDate class

https://howtodoinjava.com/java/date-time/java-time-localdate-class/

Karthik_K
New Contributor

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

This works as well

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

View solution in original post

VishKini
Occasional Contributor

Re: Date.Format failing after upgrading ReadyAPI to version 3.3.1

Thank you @tsuarezc , @richie !

cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Community

Ask Community Experts

Join more than 100,000 users worldwide. Ask questions, request features, post replies, award kudos, and more.

Join Now For Free

Already a member? Sign In