Skip to content

Commit bf394a1

Browse files
committed
Inline values to make Javadoc more user-friendly
1 parent a4661b4 commit bf394a1

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,10 @@
196196
* The display name to be used for individual invocations of the
197197
* parameterized test; never blank or consisting solely of whitespace.
198198
*
199-
* <p>Defaults to <code>{default_display_name}</code>.
199+
* <p>Defaults to <code>{@value ParameterizedTestExtension#DEFAULT_DISPLAY_NAME}</code>.
200200
*
201-
* <p>If the default display name flag (<code>{default_display_name}</code>)
201+
* <p>If the default display name flag
202+
* (<code>{@value ParameterizedTestExtension#DEFAULT_DISPLAY_NAME}</code>)
202203
* is not overridden, JUnit will:
203204
* <ul>
204205
* <li>Look up the {@value ParameterizedTestExtension#DISPLAY_NAME_PATTERN_KEY}
@@ -207,30 +208,30 @@
207208
* Gradle and Maven), a JVM system property, or the JUnit Platform configuration
208209
* file (i.e., a file named {@code junit-platform.properties} in the root of
209210
* the class path). Consult the User Guide for further information.</li>
210-
* <li>Otherwise, the value of the {@link #DEFAULT_DISPLAY_NAME} constant will
211-
* be used.</li>
211+
* <li>Otherwise, <code>{@value #DEFAULT_DISPLAY_NAME}</code> will be used.</li>
212212
* </ul>
213213
*
214214
* <h4>Supported placeholders</h4>
215215
* <ul>
216-
* <li>{@link #DISPLAY_NAME_PLACEHOLDER}</li>
217-
* <li>{@link #INDEX_PLACEHOLDER}</li>
218-
* <li>{@link #ARGUMENTS_PLACEHOLDER}</li>
219-
* <li>{@link #ARGUMENTS_WITH_NAMES_PLACEHOLDER}</li>
220-
* <li><code>{0}</code>, <code>{1}</code>, etc.: an individual argument (0-based)</li>
216+
* <li><code>{@value #DISPLAY_NAME_PLACEHOLDER}</code></li>
217+
* <li><code>{@value #INDEX_PLACEHOLDER}</code></li>
218+
* <li><code>{@value #ARGUMENTS_PLACEHOLDER}</code></li>
219+
* <li><code>{@value #ARGUMENTS_WITH_NAMES_PLACEHOLDER}</code></li>
220+
* <li><code>"{0}"</code>, <code>"{1}"</code>, etc.: an individual argument (0-based)</li>
221221
* </ul>
222222
*
223223
* <p>For the latter, you may use {@link java.text.MessageFormat} patterns
224-
* to customize formatting. Please note that the original arguments are
225-
* passed when formatting, regardless of any implicit or explicit argument
226-
* conversions.
224+
* to customize formatting (for example, {@code {0,number,#.###}}). Please
225+
* note that the original arguments are passed when formatting, regardless
226+
* of any implicit or explicit argument conversions.
227227
*
228-
* <p>Note that <code>{default_display_name}</code> is a flag rather than a
229-
* placeholder.
228+
* <p>Note that
229+
* <code>{@value ParameterizedTestExtension#DEFAULT_DISPLAY_NAME}</code> is
230+
* a flag rather than a placeholder.
230231
*
231232
* @see java.text.MessageFormat
232233
*/
233-
String name() default "{default_display_name}";
234+
String name() default ParameterizedTestExtension.DEFAULT_DISPLAY_NAME;
234235

235236
/**
236237
* Configure whether all arguments of the parameterized test that implement {@link AutoCloseable}

junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ParameterizedTestExtension implements TestTemplateInvocationContextProvide
3939

4040
private static final String METHOD_CONTEXT_KEY = "context";
4141
static final String ARGUMENT_MAX_LENGTH_KEY = "junit.jupiter.params.displayname.argument.maxlength";
42-
private static final String DEFAULT_DISPLAY_NAME = "{default_display_name}";
42+
static final String DEFAULT_DISPLAY_NAME = "{default_display_name}";
4343
static final String DISPLAY_NAME_PATTERN_KEY = "junit.jupiter.params.displayname.default";
4444

4545
@Override

0 commit comments

Comments
 (0)