Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
(cherry picked from commit c295788)
  • Loading branch information
sbrannen committed Nov 4, 2023
1 parent 5ce280e commit 1d1eb85
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 @@ -1388,7 +1389,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 @@ -1397,7 +1398,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 @@ -1406,7 +1407,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 @@ -1415,8 +1416,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 @@ -1425,7 +1425,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 @@ -1434,8 +1434,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 @@ -1444,7 +1443,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 @@ -1453,8 +1452,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 1d1eb85

Please sign in to comment.