Forum Discussion

MRutten's avatar
MRutten
Occasional Contributor
5 years ago

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

  • Because of java update in 3.3.1

    Use
    <ZKN:einddatumGepland>${= java.time.LocalDateTime.now().plusDays(10).format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd"))}</ZKN:einddatumGepland>