JsonUnit
JsonUnit copied to clipboard
Add methods for dates
Please, add follow:
- ${json-unit.current-date.format:yyyy-MM-dd} - current date and change format
- ${json-unit.current-date.DAYS#+1} - take current date and add some days, hours, or monthes
- ${json-unit.current-date.DAYS#+1.format:yyyy-MM-dd} - take current date and add/remove some days, hours, or monthes WITH formatting
- ${json-unit.current-date.HOURS#-1.format:yyyy-MM-dd} - take current date and remove some hours WITH formatting
Hi, thanks for feedback. I do not think this is a use-case so common that it should be part of the library. Luckily, you can implement it yourself using custom matchers
I think its so, beacuse wiremock uses ur library. http://wiremock.org/docs/request-matching/ -> Placeholders
It is used in many companies, in many frameworks and everyone has to write custom matchers. Wiremock is used for API testing. The API is tested in each company that has an API. Now microservices are popular, and therefore API testing, where Wiremock is used, which uses your library. And a huge number of requests pass the dates, and in order not to change every day of the date, we all need this pattern
So, and here i found one more same request :) https://github.com/tomakehurst/wiremock/issues/964
@NewbieProger @lukas-krecan If this issue still needs solving, I' d like to take it.
@NewbieProger @lukas-krecan If this issue still needs solving, I' d like to take it.
Yes, I need
@rgseyvie Hi, feel free to try it. But before you begin, can you please
- Describe the format how the matcher is going to be configured
- Check similar libraries like Wiremock how they solve it and how it's configured so we do not have to reinvent the wheel
and add formats with seconds, millisecondes. With timezone and some else examples))