ReadyAPI 3.3.1 is not understanding my code to add days to a date (version 3.1.0 did!)
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ReadyAPI 3.3.1 is not understanding my code to add days to a date (version 3.1.0 did!)
with version 3.1.0 this was working perfectly in XML request (adding 10 days to systemdate):
<ZKN:einddatumGepland>${=new java.text.SimpleDateFormat("yyyyMMdd").format(new java.util.Date()+10)}</ZKN:einddatumGepland>
with version 3.3.1 the date-value is not added to the XML. Instead some error text is added:
No signature of method: java.util.Date.plus() is applicable for argument types: (Integer) values: [10] Possible solutions: parse(java.lang.String), split(groovy.lang.Closure), is(java.lang.Object), use([Ljava.lang.Object;), wait(),
What's changed or what am i missing?
Kind regards,
Maarten Rutten
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for posting your question @MRutten!
@HimanshuTayal @richie @nmrao , what do you think might be causing this?🙂
Sonya Mihaljova
Community and Education Specialist
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use
<ZKN:einddatumGepland>${= java.time.LocalDateTime.now().plusDays(10).format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd"))}</ZKN:einddatumGepland>
Regards,
Rao.
- 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/
