Skip to content

Conversation

bibekparajuli123
Copy link
Contributor

pull request

Description

Add @DisplayName annotations to test methods based on canonical data

Changes

Added DisplayName annotations to the following exercises:

  • rectangles
  • relative-distance
  • resistor-color-duo
  • resistor-color-trio
  • resistor-color
  • rest-api
  • reverse-string

Testing

All tests pass successfully (verified with ./gradlew test)

Related Issue

Addresses #2971 (DisplayName annotations initiative)


Reviewer Resources:

Track Policies

Copy link
Contributor

github-actions bot commented Sep 5, 2025

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

Copy link
Member

@jagdish-15 jagdish-15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, @bibekparajuli123!
Just a couple of small nits to address.

Comment on lines 2 to 4
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

Can you also move this up, so the imports are nicely arranged in a alphabetical order?

Comment on lines 1 to 4
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

This one too!

Comment on lines 1 to 5
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import static org.assertj.core.api.Assertions.assertThat;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

@bibekparajuli123
Copy link
Contributor Author

Good work, @bibekparajuli123! Just a couple of small nits to address.
Fixed in latest commit

@@ -194,6 +201,7 @@ public void testComplexGraphNoShortcutFarRemovedNephew() {

@Disabled("Remove to run test")
@Test
@DisplayName("Complex graph, some shortcuts, cross-down and cross-up, cousins several times removed, with unrelated family tree")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@DisplayName("Complex graph, some shortcuts, cross-down and cross-up, cousins several times removed, with unrelated family tree")
@DisplayName(
"Complex graph, some shortcuts, cross-down and cross-up, " +
"cousins several times removed, with unrelated family tree"
)

This change will fix the checkstyle error. The line length needs to be under 120 characters, which is why the tests were failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this! I've fixed the long display name by breaking it into multiple lines as suggested.
The checkstyle error should now be resolved. Thanks for the guidance!

@jagdish-15 jagdish-15 merged commit 21f79eb into exercism:main Sep 5, 2025
4 checks passed
@bibekparajuli123 bibekparajuli123 deleted the issue-2971-display-names branch September 6, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants