Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-3794

Simplify usage of LocalDatetimeUtil

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: L3 - Default L3 - Default
    • 3.2.0
    • None
    • backend
    • None
    • Not defined

      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();
        

        This is the controller panel for Smart Panels app

              Unassigned Unassigned
              sebastian.bathke Sebastian Bathke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: