sta-szek / pojo-tester

Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)
http://www.pojo.pl
GNU Lesser General Public License v3.0
53 stars 26 forks source link

Timestamp break Equals #221

Closed hajlaoui-nader closed 6 years ago

hajlaoui-nader commented 7 years ago

Testing a pojo with a Timestamp value, break the equals method and then the assertion return false. Here's a minimal example :

public class MyPOJO {
       private Timestamp timestamp;
}
    @Test
    public void pojosTest() {
        assertPojoMethodsForAll(MyPOJO.class).areWellImplemented();
    }
sta-szek commented 7 years ago

I cannot reproduce this on 0.7.5 and 0.7.6 versions.

You are missing equas, hashcode, tostring getters and setters on MyPOJO.

I made tests on class:

@Data
public class MyPOJO {
    private java.sql.Timestamp timestamp1;
//    private java.security.Timestamp timestamp2;
}

and the tests are passing.

@hajlaoui-nader can you tell me which version of pojo-tester do you use? Which Timestamp object do you use? java.sql is working as expected but java.security one is failing.

hajlaoui-nader commented 6 years ago

@sta-szek thank you for your comment, i'll provide a full example asap. you can discard this issue.

hajlaoui-nader commented 6 years ago

@sta-szek i'm sorry for bothering, i found out that the bug is not related to pojo-tester, something's wrong with lombok and java.sql.timestamp !

Thank you for your time