-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 IndicativeSentences
DisplayNameGenerator
#4349
Closed
sbrannen
wants to merge
1
commit into
junit-team:main
from
sbrannen:issues/4347-sentence-fragment-annotation
Closed
Introduce @SentenceFragment
for IndicativeSentences
DisplayNameGenerator
#4349
sbrannen
wants to merge
1
commit into
junit-team:main
from
sbrannen:issues/4347-sentence-fragment-annotation
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 task
2bc268d
to
bb86a1d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
1 task
marcphilipp
approved these changes
Mar 1, 2025
junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java
Outdated
Show resolved
Hide resolved
junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java
Outdated
Show resolved
Hide resolved
sbrannen
added a commit
that referenced
this pull request
Mar 2, 2025
b84ef61
to
fd4b608
Compare
sbrannen
commented
Mar 2, 2025
junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java
Show resolved
Hide resolved
Prior to this commit, it was not possible to provide a custom display name for an individual "sentence fragment" for the IndicativeSentences DisplayNameGenerator. Although it is possible to register a custom DisplayNameGenerator (such as ReplaceUnderscores) to affect how a sentence fragment is generated, you previously could not provide an entire custom sentence fragment. In addition, attempting to use @DisplayName for a sentence fragment results in the entire sentence (that would otherwise be generated by the IndicativeSentences DisplayNameGenerator) getting overridden by the value of the @DisplayName for the current test class or test method. To address that shortcoming, this commit introduces a new @SentenceFragment annotation that can be used to specify custom sentence fragments when using the IndicativeSentences DisplayNameGenerator. Closes junit-team#4347 Closes junit-team#4349
fd4b608
to
03023da
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces
@SentenceFragment
for theIndicativeSentences
DisplayNameGenerator
.Related Issues
@SentenceFragment
for use withIndicativeSentences
DisplayNameGenerator
#4347Definition of Done
@API
annotations