@Test void staticFieldsShouldBeExcluded() throws NoSuchFieldException { Field field = Human.class.getDeclaredField("SERIAL_VERSION_UID"); boolean actual = exclusionPolicy.shouldBeExcluded(field, randomizerContext); assertThat(actual).isTrue(); }
public boolean shouldBeExcluded(final Field field, final RandomizerContext context) { if (isStatic(field)) { return true; } Set<Predicate<Field>> fieldExclusionPredicates = context.getParameters().getFieldExclusionPredicates(); for (Predicate<Field> fieldExclusionPredicate : fieldExclusionPredicates) { if (fieldExclusionPredicate.test(field)) { return true; } } return false; }
DefaultExclusionPolicy implements ExclusionPolicy { public boolean shouldBeExcluded(final Field field, final RandomizerContext context) { if (isStatic(field)) { return true; } Set<Predicate<Field>> fieldExclusionPredicates = context.getParameters().getFieldExclusionPredicates(); for (Predicate<Field> fieldExclusionPredicate : fieldExclusionPredicates) { if (fieldExclusionPredicate.test(field)) { return true; } } return false; } }
DefaultExclusionPolicy implements ExclusionPolicy { public boolean shouldBeExcluded(final Field field, final RandomizerContext context) { if (isStatic(field)) { return true; } Set<Predicate<Field>> fieldExclusionPredicates = context.getParameters().getFieldExclusionPredicates(); for (Predicate<Field> fieldExclusionPredicate : fieldExclusionPredicates) { if (fieldExclusionPredicate.test(field)) { return true; } } return false; }  }
DefaultExclusionPolicy implements ExclusionPolicy { public boolean shouldBeExcluded(final Field field, final RandomizerContext context) { if (isStatic(field)) { return true; } Set<Predicate<Field>> fieldExclusionPredicates = context.getParameters().getFieldExclusionPredicates(); for (Predicate<Field> fieldExclusionPredicate : fieldExclusionPredicates) { if (fieldExclusionPredicate.test(field)) { return true; } } return false; }  boolean shouldBeExcluded(final Field field, final RandomizerContext context); boolean shouldBeExcluded(final Class<?> type, final RandomizerContext context); }
DefaultExclusionPolicy implements ExclusionPolicy { public boolean shouldBeExcluded(final Field field, final RandomizerContext context) { if (isStatic(field)) { return true; } Set<Predicate<Field>> fieldExclusionPredicates = context.getParameters().getFieldExclusionPredicates(); for (Predicate<Field> fieldExclusionPredicate : fieldExclusionPredicates) { if (fieldExclusionPredicate.test(field)) { return true; } } return false; }  boolean shouldBeExcluded(final Field field, final RandomizerContext context); boolean shouldBeExcluded(final Class<?> type, final RandomizerContext context);  }