cancel
Showing results for 
Search instead for 
Did you mean: 

Ready API 3.3.1 - messed date up

SOLVED
Highlighted
Occasional Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Ready API 3.3.1 - messed date up

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>


Regards,
Rao.

View solution in original post

16 REPLIES 16
Highlighted
Community Hero

Re: Ready API 3.3.1 - messed date up

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>


Regards,
Rao.

View solution in original post

Highlighted
Occasional Contributor

Re: Ready API 3.3.1 - messed date up

I'm not sure what you mean by using Java 8? 

     I'm just using ReadyAPI, so it's the Java version that is wrapped in it. 

 

Is there a way to use the other class or is that deprecated? 

     We will have to do a bunch of rewrites along with manipulating the date by adding or subtracting a day as well. 

 

If we can load in the class that allows us to use the previous way then that would buy us some time.  Is that possible?

Highlighted
Contributor

Re: Ready API 3.3.1 - messed date up

@khanchett 

Even I'm facing same issue, all of my test cases used date.format function, so all of them are failing.

Not sure how local JDK version matters to ReadyAPI, anyway I'm having Java 8, but still facing issue, I'm also reverting to 3.3.0. Hope SmartBear will fix it soon.

 

 

 

Highlighted
Community Hero

Re: Ready API 3.3.1 - messed date up

Would you please mind trying the solution first?

You can check what version of java from Ready API.

As the error says, there is no such method. Lot of changes to Date in java 8.

If there are multiple places using the same code, then try considering to use library. Otherwise use search and replace in the project file in your preferred text editor, have a backup before doing so.


Regards,
Rao.
Highlighted
Community Hero

Re: Ready API 3.3.1 - messed date up

By the way, the issue is not with the tool, but with the underlying java version.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Ready API 3.3.1 - messed date up

According to the ReadyAPI menu: Help -> System Properties the Java version used is 12. 

 

My local machine I have Java 8 installed.  I have not changed anything as far as the Java version on my local machine when I updated from 3.3.0 to 3.3.1, so I'm confused as to what changed with ReadyAPI?

 

I understand what you are saying I would like to know what is happening so I can better understand how Ready API works.  If they are using an internal Java version from my own, that would be good to know.  I have tried your fix and it does work, but why is this now necessary and why can I not use what I currently have instead?  If there is going to be an update of the Java version being used it would be good of SmartBear to note that in there version update notes.

 

I will remain on 3.3.0 until I can find time to work these things out.  I do have groovy in the XML requests, so a library won't help here.  

 

Thank you @nmrao for your help here.  

Highlighted
Contributor

Re: Ready API 3.3.1 - messed date up

@nmrao 

1) I tried your solution, It's working fine(I checked for current time). Thanks for work around. But I have to look for LocalDate.now() how it work for time manipulations(Previous dates, future dates, different time zones, etc..).

 

2)  Java Version:  I'm bit confuse here, If I''m not wrong from even Ready API 3.3.0 also using Java 8(or more), they did update Java12 for 3.3.1. So in this case both versions have latest Java & 3.3.1 should work with date.formate. But not sure where we are missing.

Highlighted
Community Hero

Re: Ready API 3.3.1 - messed date up

So, Date.format might be deprecated in Java 8 and removed in Java 12 which is used by ReadyAPI.

@PrathapR, this is not workaround, that is the correct way.


Regards,
Rao.
Occasional Contributor

Re: Ready API 3.3.1 - messed date up

The 3.3.0 is also using 12. 

 

So my guess is that Ready API maybe updated the 12 version to a more recent version of 12 and that the deprecated version of date is now removed?

 

So if I'm not mistaken to my question, ReadyAPI is then using internal Java files, not what is on my local machine?

 

Thank you!

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors