Closed
Description
Overview
@FieldSource
was introduced in JUnit Jupiter 5.11 for use with @ParameterizedTest
methods.
Similar to @MethodSource
which allows developers to supply a fully-qualified method name, @FieldSource
allows developers to supply a fully-qualified field name.
Native Build Tools already registers reflection metadata for fully-qualified method names for @MethodSource
here:
Similar support should be added for @FieldSource
. For example, given the following parameterized test, reflection metadata should be registered for the example.FruitUtils#tropicalFruits
field.
@ParameterizedTest
@FieldSource("example.FruitUtils#tropicalFruits")
void testWithExternalFieldSource(String tropicalFruit) {
// test with tropicalFruit
}