Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Nov 4, 2023
1 parent 0a514b9 commit c295788
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static org.junit.platform.commons.function.Try.success;
import static org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode.BOTTOM_UP;
import static org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode.TOP_DOWN;
import static org.junit.platform.commons.util.ReflectionUtils.findFields;
import static org.junit.platform.commons.util.ReflectionUtils.findMethod;
import static org.junit.platform.commons.util.ReflectionUtils.findMethods;
import static org.junit.platform.commons.util.ReflectionUtils.invokeMethod;
Expand Down Expand Up @@ -1387,7 +1388,7 @@ void readFieldValuesPreconditions() {

@Test
void readFieldValuesFromInstance() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, f -> true, TOP_DOWN);
var fields = findFields(ClassWithFields.class, f -> true, TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, new ClassWithFields());

Expand All @@ -1396,7 +1397,7 @@ void readFieldValuesFromInstance() {

@Test
void readFieldValuesFromClass() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, ReflectionUtils::isStatic, TOP_DOWN);
var fields = findFields(ClassWithFields.class, ReflectionUtils::isStatic, TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, null);

Expand All @@ -1405,7 +1406,7 @@ void readFieldValuesFromClass() {

@Test
void readFieldValuesFromInstanceWithTypeFilterForString() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, isA(String.class), TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(String.class), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, new ClassWithFields(), isA(String.class));

Expand All @@ -1414,8 +1415,7 @@ void readFieldValuesFromInstanceWithTypeFilterForString() {

@Test
void readFieldValuesFromClassWithTypeFilterForString() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, isA(String.class).and(ReflectionUtils::isStatic),
TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(String.class).and(ReflectionUtils::isStatic), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, null, isA(String.class));

Expand All @@ -1424,7 +1424,7 @@ void readFieldValuesFromClassWithTypeFilterForString() {

@Test
void readFieldValuesFromInstanceWithTypeFilterForInteger() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, isA(int.class), TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(int.class), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, new ClassWithFields(), isA(int.class));

Expand All @@ -1433,8 +1433,7 @@ void readFieldValuesFromInstanceWithTypeFilterForInteger() {

@Test
void readFieldValuesFromClassWithTypeFilterForInteger() {
var fields = ReflectionUtils.findFields(ClassWithFields.class,
isA(Integer.class).and(ReflectionUtils::isStatic), TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(Integer.class).and(ReflectionUtils::isStatic), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, null, isA(Integer.class));

Expand All @@ -1443,7 +1442,7 @@ void readFieldValuesFromClassWithTypeFilterForInteger() {

@Test
void readFieldValuesFromInstanceWithTypeFilterForDouble() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, isA(double.class), TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(double.class), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, new ClassWithFields(), isA(double.class));

Expand All @@ -1452,8 +1451,7 @@ void readFieldValuesFromInstanceWithTypeFilterForDouble() {

@Test
void readFieldValuesFromClassWithTypeFilterForDouble() {
var fields = ReflectionUtils.findFields(ClassWithFields.class, isA(Double.class).and(ReflectionUtils::isStatic),
TOP_DOWN);
var fields = findFields(ClassWithFields.class, isA(Double.class).and(ReflectionUtils::isStatic), TOP_DOWN);

var values = ReflectionUtils.readFieldValues(fields, null, isA(Double.class));

Expand Down

0 comments on commit c295788

Please sign in to comment.