Repository navigation
Add @DisplayName to Test Methods in Practice Exercises #2971
Description
📝 Issue Description
This issue aims to add @DisplayName() annotations for every test method in the test files of all practice exercises in the Java track.
🔧 What You Need to Do
-
Skip unsynced exercises:
Before starting, make sure the exercise is not listed among the ones with unsynced tests in issue #2959. -
Locate the test file:
- Go to the exercise folder inside
exercises/practice/<exercise-name>/src/test. - Open the Java test file (typically named
<ExerciseName>Test.java).
- Go to the exercise folder inside
-
Find the canonical source:
- Navigate to the problem-specifications repo.
- Open the corresponding exercise folder and locate
canonical-data.json.
-
Match and annotate tests:
- The test cases in the
.jsonfile are listed in a specific order. - Match the tests in the Java file with the ones in
canonical-data.json. - For each test, copy the
"description"and use it as a@DisplayName("")annotation above the corresponding method in the Java test file.
- The test cases in the
⚠️ Important Guidelines
-
Max 15 exercises per PR:
To avoid large PRs, limit the number of exercises being updated in each PR to a maximum of 15 exercises (less is ok too). -
Do not close this issue via PRs:
Avoid referencing this issue in your PR with terms likeFixes #XXXorResolves #XXX, since this would automatically close the issue. -
Avoid reimplemented exercises:
Make sure you are not copying descriptions from tests that have been reimplemented. -
Need help?
If you have any questions, feel free to ask in the comments!
📋 Checklist of Practice Exercises
- acronym
- affine-cipher
- all-your-base
- allergies
- alphametics
- anagram
- armstrong-numbers
- atbash-cipher
- bank-account
- binary-search-tree
- binary-search
- bob
- book-store
- bottle-song
- bowling
- change
- circular-2buffer
- clock
- collatz-conjecture
- complex-numbers
- connect
- crypto-square
- custom-set
- darts
- diamond
- difference-of-squares
- dnd-character
- dominoes
- dot-dsl
- eliuds-eggs
- error-handling
- etl
- flatten-array
- flower-field
- food-chain
- forth
- game-of-life
- gigasecond
- go-counting
- grade-school
- grains
- grep
- hamming
- hangman
- hello-world
- high-scores
- house
- isbn-verifier
- isogram
- killer-sudoku-helper
- kindergarten-garden
- knapsack
- largest-series-product
- leap
- ledger
- linked-list
- list-ops
- luhn
- markdown
- matching-brackets
- matrix
- mazy-mice
- meetup
- micro-blog
- nth-prime
- nucleotide-count
- ocr-numbers
- palindrome-products
- pangram
- parallel-letter-frequency
- pascals-triangle
- perfect-numbers
- phone-number
- piecing-it-together
- pig-latin
- poker
- pov
- prime-factors
- protein-translation
- proverb
- pythagorean-triplet
- queen-attack
- rail-fence-cipher
- raindrops
- rational-numbers
- react
- rectangles
- relative-distance
- resistor-color-duo
- resistor-color-trio
- resistor-color
- rest-api
- reverse-string
- rna-transcription
- robot-name
- robot-simulator
- roman-numerals
- rotational-cipher
- run-length-encoding
- saddle-points
- satellite
- say
- scrabble-score
- secret-handshake
- series
- sgf-parsing
- sieve
- simple-cipher
- simple-linked-list
- space-age
- spiral-matrix
- square-root
- state-of-tic-tac-toe
- sublist
- sum-of-multiples
- swift-scheduling
- tournament
- transpose
- tree-building
- triangle
- twelve-days
- two-bucket
- two-fer
- variable-length-quantity
- word-count
- word-search
- wordy
- yacht
- zebra-puzzle
- zipper
💡 Reference Example
To understand how to properly add @DisplayName annotations based on canonical-data.json, you can refer to the test file in the Swift Scheduling exercise.
It already includes correctly formatted @DisplayName entries matching the test case descriptions, making it a good template for how your test file should look after the changes.
Activity
EmmanuelBerkowicz commentedon Jul 8, 2025
Hi @kahgoh & @jagdish-15
My name is Emmanuel and I'm relatively new to open source contributions. This looks like an excellent opportunity for me to improve my Java skills while contributing to Exercism, which has been incredibly helpful in my TypeScript learning journey.
I'd love to work on this issue and would appreciate being assigned to it. I understand the guidelines about:
I'm planning to start with a smaller batch (maybe 5-10 exercises) for my first PR to get comfortable with the workflow, then continue with additional PRs as needed.
Could you please assign me to this issue? I'm excited to contribute and help improve the Java track's test documentation!
Thanks!
kahgoh commentedon Jul 8, 2025
Thanks for taking this on @EmmanuelBerkowicz! I have just assigned this one to you.
Add @DisplayName to Test Methods in Practice Exercises exercism#2971
EmmanuelBerkowicz commentedon Jul 15, 2025
Hey @kahgoh ,
I've not used IntelliJ CheckStyle before.
It looks like that is the reason my pull request is not going through (ref attached image).
I've restarted my IDE with the plugin installed, and it's not showing anything different.
Is there anything obvious I might have overlooked or can do to push this through?
kahgoh commentedon Jul 15, 2025
Sorry I'm not familar with the IntelliJ plugin, but I wonder if you need to do something to run it. With Gradle, you should also be to run it with
./gradlew check.In terms of the error in the CI, this is specific error:
jagdish-15 commentedon Jul 15, 2025
I've also added a few comments on the PR regarding this error!
Merge branch 'main' into Practice-Exercises-exercism#2971
EmmanuelBerkowicz commentedon Jul 22, 2025
Thanks guys!
I've committed the suggested change :)
Add @DisplayName to Test Methods in Practice Exercises #2971 (#2972)
jagdish-15 commentedon Jul 22, 2025
@EmmanuelBerkowicz,
The PR is merged now! You can now start working on other exercises.
EmmanuelBerkowicz commentedon Aug 3, 2025
hey @jagdish-15 ,
Is this closed?
20 remaining items
jagdish-15 commentedon Nov 17, 2025
@manjarekarsudip
Yes, the issue is still active, and the list is up-to-date. You can raise a PR for any exercises not already checked off, unless there’s an existing PR for them (there aren’t any at the moment).
I’ll assign this issue to you as well!
dsaladbar617 commentedon Nov 18, 2025
Hello, I will be looking through the list as well and plan to drop a pr for this as well. I don't know if it needs to be assigned to me, but willing to take it.
Issue exercism#2971 Add display names to tests
Issue #2971 display names (#3055)
Mihir0106 commentedon Dec 1, 2025
@jagdish-15 Is it ok if i join in this issue task as well?
Issue exercism#2971 Add display names to tests
Issue #2971 Add display names to tests (#3057)
Baboushka commentedon Dec 13, 2025
Hello @jagdish-15, I'll push a PR for the remaining zipper exercice, since the others seem to be merged already.
jagdish-15 commentedon Dec 13, 2025
#3064 This is intended to be the final PR for this issue. I picked it up myself because the
problem-specificationsrepo didn’t have acanonical-data.jsonfile. I’d appreciate your review, @kahgoh.jagdish-15 commentedon Dec 17, 2025
Thanks everyone for the contributions! The last PR completes everything, so we can close this issue.
Issue exercism#2971 display names (exercism#3055)
Issue exercism#2971 Add display names to tests (exercism#3057)