Skip to content

Commit 8a41632

Browse files
committed
Clarify requirements for ArgumentConverter/Aggregator implementations
Issue: #1397
1 parent 6ddb17d commit 8a41632

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
* In addition, {@link ArgumentsAggregator} implementations are given access to
3333
* an {@code ArgumentsAccessor}.
3434
*
35+
* <p>This interface is not intended to be implemented by clients.
36+
*
3537
* @since 5.2
3638
* @see ArgumentsAggregator
3739
* @see org.junit.jupiter.params.ParameterizedTest

junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
* in a CSV file into a domain object such as a {@code Person}, {@code Address},
3434
* {@code Order}, etc.
3535
*
36-
* <p>Implementations must provide a no-args constructor.
36+
* <p>Implementations must provide a no-args constructor and should not make any
37+
* assumptions on when they are instantiated or how often they are called. Since
38+
* instances may potentially be cached and called from different threads they
39+
* should be thread-safe and designed to be used as singletons.
3740
*
3841
* @since 5.2
3942
* @see AggregateWith

junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
* to know about the target type instead of the complete
2929
* {@link ParameterContext}.
3030
*
31-
* <p>Implementations must provide a no-args constructor.
31+
* <p>Implementations must provide a no-args constructor and should not make any
32+
* assumptions on when they are instantiated or how often they are called. Since
33+
* instances may potentially be cached and called from different threads they
34+
* should be thread-safe and designed to be used as singletons.
3235
*
3336
* @since 5.0
3437
* @see SimpleArgumentConverter

0 commit comments

Comments
 (0)