Skip to content

Commit

Permalink
#68. Extracted method from if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Joński committed Sep 9, 2016
1 parent 74d253a commit d2be804
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ coverage:
round: down
range: "80...100"

status:
project:
default:
threshold: 1%

notify:

gitter:
default:
url: https://webhooks.gitter.im/e/b688071667f9bb1d01e2

status:
project:
default:
threshold: 1%
6 changes: 5 additions & 1 deletion src/main/java/org/pojo/tester/SetterGetterTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void testSetterAndGetter(final SetterAndGetterPair eachPair, final Objec
final Object newValue = objectGenerator.createNewInstance(fieldType);

try {
if (setter != null) {
if (hasSetter(setter)) {
assertions.assertThatSetMethodFor(instance)
.willSetValueOnField(setter, field, newValue);
}
Expand All @@ -51,6 +51,10 @@ private void testSetterAndGetter(final SetterAndGetterPair eachPair, final Objec
}
}

private boolean hasSetter(final Method setter) {
return setter != null;
}

private boolean isNotFinal(final Field field) {
return !FieldUtils.isFinal(field);
}
Expand Down

0 comments on commit d2be804

Please sign in to comment.