{"action":"opened","issue":{"url":"https://api.github.com/repos/sta-szek/pojo-tester/issues/151","repository_url":"https://api.github.com/repos/sta-szek/pojo-tester","labels_url":"https://api.github.com/repos/sta-szek/pojo-tester/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/sta-szek/pojo-tester/issues/151/comments","events_url":"https://api.github.com/repos/sta-szek/pojo-tester/issues/151/events","html_url":"https://github.com/sta-szek/pojo-tester/issues/151","id":195778550,"number":151,"title":"Method.EQUALS: test fails for equal objects","user":{"login":"SemionPar","id":12086191,"avatar_url":"https://avatars.githubusercontent.com/u/12086191?v=3","gravatar_id":"","url":"https://api.github.com/users/SemionPar","html_url":"https://github.com/SemionPar","followers_url":"https://api.github.com/users/SemionPar/followers","following_url":"https://api.github.com/users/SemionPar/following{/other_user}","gists_url":"https://api.github.com/users/SemionPar/gists{/gist_id}","starred_url":"https://api.github.com/users/SemionPar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SemionPar/subscriptions","organizations_url":"https://api.github.com/users/SemionPar/orgs","repos_url":"https://api.github.com/users/SemionPar/repos","events_url":"https://api.github.com/users/SemionPar/events{/privacy}","received_events_url":"https://api.github.com/users/SemionPar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T11:11:59Z","updated_at":"2016-12-15T11:11:59Z","closed_at":null,"body":"Use this setup to reproduce the bug.\r\nTwo nested classes:\r\n```java\r\n@Data\r\npublic class A {\r\n    private long userId;\r\n    private B withdraw;\r\n}\r\n```\r\n\r\n```java\r\n@Data\r\npublic class B {\r\n    private CurrencySymbol currency;\r\n    private Money amount;\r\n    private long account;\r\n}\r\n```\r\n\r\nNow, here is how I test both classes in a single test case:\r\n```java\r\n    @Test\r\n    public void shouldTestEquals() {\r\n        // given\r\n        final Class[] classesUnderTest = { A.class,\r\n                                           B.class};\r\n        // when\r\n        // then\r\n        assertPojoMethodsForAll(classesUnderTest).create(Money.class, MONEY_CONSTRUCTOR_PARAMETERS)\r\n                                                 .create(CurrencySymbol.class, CURRENCY_SYMBOL_CONSTRUCTOR_PARAMETERS)\r\n                                                 .testing(Method.EQUALS)\r\n                                                 .areWellImplemented();\r\n    }\r\n```\r\n\r\nThis results in the following error:\r\n```\r\nClass package.A has bad 'equals' method implementation.\r\nThe equals method should return false if objects should not be equal.\r\nCurrent implementation returns true.\r\nObject:\r\npackage.A@d7f2a\r\nshould not be equal to:\r\npackage.A@d7f2a\r\npl.pojo.tester.internal.assertion.equals.NotEqualEqualsAssertionError: \r\n\r\n\r\nClass package.A has bad 'equals' method implementation.\r\nThe equals method should return false if objects should not be equal.\r\nCurrent implementation returns true.\r\nObject:\r\npackage.A@d7f2a\r\nshould not be equal to:\r\npackage.A@d7f2a\r\n```\r\nObjects are obviously equal, I guess there might be a bug in generators."}}
{"actor":{"display_login":"SemionPar"}}