Tamas Palfy created NIFI-6509:
---------------------------------

             Summary: Date related issue in unit test 
VolatileComponentStatusRepositoryTest
                 Key: NIFI-6509
                 URL: https://issues.apache.org/jira/browse/NIFI-6509
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
            Reporter: Tamas Palfy


Unit test 
{{VolatileComponentStatusRepositoryTest.testFilterDatesUsingPreferredDataPoints}}
 may fail with the following:
{code:java}
java.lang.AssertionError: 
Expected :Thu Jan 01 00:00:00 CET 1970
Actual   :Thu Jan 01 01:00:00 CET 1970
{code}

The test creates a {{VolatileComponentStatusRepository}} instance and adds 
{{java.util.Date}} objects to it starting from epoch (via {{new Date(0)}}).
This first date at epoch is the _Actual_ in the _AssertionError_.

Then filters this list by looking for those that are earlier or matching a 
_start_ paramater. This _start_ is created from a {{LocalDateTime}} at the 
default system time zone.
This is the _Expected_ in the _AssertionError_.

In general the issue is the difference in how the list is created (dates that 
are 00:00:00 GMT) and how the filter parameter date is created (00:00:00 at 
system time zone).

Related JIRA:
https://issues.apache.org/jira/browse/NIFI-6433



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to