-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Milestone
Description
Overview
Introduce @FieldSource
argument source for parameterized tests.
The feature is analogous to the existing @MethodSource
support, except that the value of a named field is used as the source of arguments instead of the value returned by a factory method.
See #2014 (comment) and #2014 (comment) for examples.
Deliverables
- Introduce
@FieldSource
andFieldArgumentsProvider
.- Reject fields with
Stream
values. - Reject fields with
Iterator
values. - Support
Supplier<T>
fields whereT
is a type supported for@MethodSource
. - Write unit and integration tests for preconditions, edge cases, etc.
- Provide examples, etc. in class-level Javadoc for
@FieldSource
.
- Reject fields with
- Document in the User Guide.
- Provide examples for the User Guide.
- Document in the Release Notes.
Original Issue Description
I understand that for memory/performance you probably want to recommend everyone use a Stream-returning method and @MethodSource
, but given that an @ArraySource
would be easier to use without having to convert all test data into methods, this would be a nice-to-have.
la3rence