Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce @SentenceFragment for use with IndicativeSentences DisplayNameGenerator #4347

Open
1 task
sbrannen opened this issue Feb 26, 2025 · 1 comment · May be fixed by #4349
Open
1 task

Introduce @SentenceFragment for use with IndicativeSentences DisplayNameGenerator #4347

sbrannen opened this issue Feb 26, 2025 · 1 comment · May be fixed by #4349

Comments

@sbrannen
Copy link
Member

Overview

While updating the Spring Framework test suite after the fixes for #4130 and #4131, I noticed that it's currently not possible to provide a custom display name for a "sentence fragment" for the IndicativeSentences DisplayNameGenerator.

You can of course register a custom DisplayNameGenerator (such as ReplaceUnderscores) to affect how a sentence fragment is generated, but you cannot provide an entire custom sentence fragment.

If you attempt to use @DisplayName for a sentence fragment, the entire sentence (that would otherwise be generated by the IndicativeSentences DisplayNameGenerator) gets overridden by the value of the @DisplayName.

As a proof of concept, I implemented @SentenceFragment and a corresponding SentenceFragmentDisplayNameGenerator) in this commit for Spring Framework's test suite.

Deliverables

  • Introduce support for @SentenceFragment directly in IndicativeSentences.
@sbrannen sbrannen added this to the 5.13.0-M1 milestone Feb 26, 2025
@sbrannen sbrannen self-assigned this Feb 26, 2025
sbrannen added a commit to sbrannen/junit5 that referenced this issue Feb 26, 2025
sbrannen added a commit to sbrannen/junit5 that referenced this issue Feb 27, 2025
sbrannen added a commit to sbrannen/junit5 that referenced this issue Feb 27, 2025
sbrannen added a commit to sbrannen/junit5 that referenced this issue Feb 27, 2025
sbrannen added a commit to sbrannen/junit5 that referenced this issue Feb 27, 2025
@sbrannen
Copy link
Member Author

PR #4349 is ready for a conceptual/technical review, in case anyone's interested. 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant