Context:
In the backend senate of May 2020 we discussed how we could simplify and make date assertions more reliable https://confluence.camunda.com/display/CO/2020-05-06+The+Back-End+Senate+-+June based on the prior disussions in this thread https://github.com/camunda/camunda-optimize/pull/2099#discussion_r429860944 .
We concluded that we should address this but maybe not with the suggested solution in the thread of a new "now" method. This is due to the concerns that the "now" method implies to return always a fresh timestamp which it may not. We should think of a better name or just using the already implemented `getCurrentDateTime` method and for convenience (to set and get at the same time) introduce a method named e.g. `setAndGetCurrentDateTime`
Have a look at OPT-3936. There, a new time freezer class has been introduced that eases the pain with the handling of nanosecond precision quite a bit.
AT:
- the LocalDateUtil is extended to offer a more convenient method to avoid these two lines
LocalDateUtil.setCurrentTime(OffsetDateTime.now()); OffsetDateTime now = LocalDateUtil.getCurrentDateTime();