You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I have protected getter Equalsverifier trigger JPA_GETTER warning. When getter is public everything works correctly
Caused by: java.lang.AssertionError: EqualsVerifier found a problem in class pl.interrisk.irys.auto.partner.infrastructure.adapters.db.Partner.
-> JPA Entity: direct reference to field id used in equals instead of getter getId().
def "should check equals and hashCode for Partner entity"() {
expect:
EqualsVerifier.forClass(Partner2.class)
.suppress(Warning.SURROGATE_KEY)
.suppress(Warning.IDENTICAL_COPY_FOR_VERSIONED_ENTITY)
.suppress(Warning.STRICT_HASHCODE)
.withRedefinedSuperclass()
.usingGetClass()
.withPrefabValues(PartnerCalculationView, new PartnerCalculationView(), new PartnerCalculationView())
.verify()
}
this line is a problem:
@Getter(AccessLevel.PROTECTED)
private Long id;
Error message
Caused by: java.lang.AssertionError: EqualsVerifier found a problem in class pl.interrisk.irys.auto.partner.infrastructure.adapters.db.Partner.
-> JPA Entity: direct reference to field id used in equals instead of getter getId().
Expected behavior
No warning when I use protected getter
Version
3.15.5
The text was updated successfully, but these errors were encountered:
Describe the bug
When I have protected getter Equalsverifier trigger JPA_GETTER warning. When getter is public everything works correctly
Code that triggers the behavior
And Test:
this line is a problem:
Error message
Expected behavior
No warning when I use protected getter
Version
3.15.5
The text was updated successfully, but these errors were encountered: