You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Tamas Palfy (JIRA)" <ji...@apache.org> on 2019/07/31 09:23:01 UTC

[jira] [Updated] (NIFI-6509) Date related issue in unit test VolatileComponentStatusRepositoryTest

     [ https://issues.apache.org/jira/browse/NIFI-6509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tamas Palfy updated NIFI-6509:
------------------------------
    Description: 
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).

  was:
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


> 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
>            Priority: Minor
>
> 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).



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