Repository navigation
Do not parse {displayName} placeholder for @ParameterizedTest using MessageFormat - #3264
alemendoza-v wants to merge 5 commits into
Conversation
|
@sbrannen Sure I'll get to work on these changes. Should the Release Notes entry include the basic change? Something like "Bug Fix: |
|
@sbrannen Also, should the new constant be inside the |
sbrannen
left a comment
There was a problem hiding this comment.
Thanks for making the previously requested changes.
I've requested a few additional changes after the latest review.
|
FYI: changes to the Javadoc and User Guide are not needed for this change, so I've updated the Definition of Done accordingly. |
It's good as a private constant in |
There's no need to prefix it with "Bug Fix:". There's a dedicated section for bug fixes in JUnit Jupiter. Regarding the content, it should be more generic in nature, explaining that the See what you come up with, and if we deem it necessary we will polish the wording when merging the PR. |
|
@sbrannen Thanks for reviewing, I'll get to work on the changes and the release notes entry :) |
β¦e, Add new unit test and Add static keyword to new placeholder
{displayName} placeholder for @ParameterizedTest using MessageFormat
Prior to this commit, if a @ParameterizedTest used the {displayName}
placeholder to generate a display name and the value of the displayName
contained an apostrophe (') or something resembling a MessageFormat
element (such as {data}), JUnit threw an exception due to failure to
parse the display name.
This is applicable to method names in Kotlin-based tests or custom
display names in general.
To fix this bug, instead of replacing the DISPLAY_NAME_PLACEHOLDER
before the MessageFormat is evaluated, the DISPLAY_NAME_PLACEHOLDER is
now replaced with another temporary placeholder, which is then replaced
after the MessageFormat has been evaluated.
Closes #3235
Closes #3264
|
Thank you! |
Overview
The
@ParameterizedTestannotation was breaking name generation by not allowing'in the method names for Kotlin-based tests or in custom display names in geneeral. It also made it so that placeholders were not being replaced correctly.To solve it, instead of replacing the
DISPLAY_NAME_PLACEHOLDERbefore theMessageFormatwas being evaluated, theDISPLAY_NAME_PLACEHOLDERis now replaced with another temporary placeholder, which is then replaced after theMessageFormatis evaluated.Solves: #3235
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done