Hello Team - Im creating stubs via wiremock and wh...
# wiremock-cloud
s
Hello Team - Im creating stubs via wiremock and while doing so encountered an interesting fact w.r.t the date. i have to pass tomorrow as one of t he parameter stating as "Token": "I21426-25439_{{now format='dd_MM_yyyy' offset='+1 days'}} and what im seeing is wiremock not intelligent enough to convey that Feb has only 28 or 29 days and it just adds up +1 to current date and in response sends out value as 02_31_2024 which doesnt even exist. - "Token": "I21426-25439_*02_31_2024*_07_13", if any have already noticed and have a solution to make wiremock think the dates as per calender please share your inputs. Thanks in Advance for the support
t
I’ve just tried this myself and got:
01_03_2024
That seems right to me. What’s the domain name of the mock API you’re working on?
s
Thats interesting to hear. same command and works differently
02_31 is never expected
t
If you point me to your mock API I can take a look
What’s the hostname/base URL of the one you’re working on?
s
Im trying on inside network of the customer and hence unable to share the details
t
OK, so you’re not using WireMock Cloud?
s
how can i check if Im doing wiremock cloud or not?
t
WireMock Cloud is a SaaS product so you’d have signed up and would be working in a web UI
If you’re using standalone/Docker/Java then you’re on the OSS product
How did you create the stub that returned this value?
s
using
wiremock-jre8-standalone-2.33.2.jar
t
That’s quite an old version. I would suggest upgrading to 3.4.2.
s
3.4.2 is new standalone version?
t
Yes, that’s the latest
Slightly different artifact ID though - it’s
wiremock-standalone-3.4.2.jar
s
can you point the link so i can download the legit version
t
(without the
jre8
part)
s
3.4.2 invocation everything remains same or its entirely different with new set of commands.. what are pre requiaites to run 3.4.2 version/.
t
There was very little backwards compatibility breakage in 2->3 so you should be able to use it exactly the same.
s
Thank you for the quick turn around
👍 1
will try and keep posted for any concerns
t
No worries. Hopefully the update will cure the problem, but if not please post the stub definition and we can take a closer look.
👍 1