Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pojo tests with final attributes #242

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

frecco75
Copy link
Collaborator

This PR fixes pojo tests with final fields. A setter should not be expected on a final field.

@frecco75 frecco75 requested review from ekoutanov and sta-szek March 24, 2020 00:11
@@ -46,6 +48,7 @@ private void testSetterAndGetter(final SetterAndFieldPair eachPair, final Object
private List<SetterAndFieldPair> findSetterAndGetterPairsForFields(final Class<?> testedClass,
final List<Field> fields) {
return fields.stream()
.filter(field -> ! isFinal(field))
Copy link
Collaborator Author

@frecco75 frecco75 Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it depends which PR is merged first.
If support for java 13... we can replace this line by .filter(not(FieldUtils::isFinal))

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we still need to test getters, as it was.
setters can be skipped in case of final classes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getter is still tested. We are in the SetterTester class, the object of this pull request is to not test setter method on a final field.

@sta-szek sta-szek merged commit 0860ba7 into sta-szek:master Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants