Simplify AssertJ assertions flagged by Sonar (java:S5838)

Open Beginner friendly
#736 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing

Research direction

Choose one module and comment here to claim that scope. In that module, inspect the SonarCloud java:S5838 findings; the issue names ComputeTest lines 708 and 767 as examples in reader. Replace only assertions with more specific AssertJ forms, preserving the Given/When/Then structure and avoiding containsExactly for large arrays. Run ./mvnw test -pl <module> -am; done when its tests pass and the change remains test-only.

Written by the indexing model from the issue text.

Description

good first issue

SonarCloud flags 23 assertions that have a more specific AssertJ form, e.g. assertThat(map.get(k)).isEqualTo(v) should be assertThat(map).containsEntry(k, v). The more specific form gives a better failure message.

Where: reader 17 (e.g. ComputeTest:708, :767), writer 3, and one each in fsst, calcite, integration. List: java:S5838 open issues.

How: pick one module, say so in a comment here, and send one PR. Test-only and behavior-neutral: ./mvnw test -pl <module> -am must stay green. Keep the // Given / // When / // Then structure. See CONTRIBUTING.md.

Beware: AssertJ's containsExactly on big arrays is quadratic; do not use it to replace isEqualTo on arrays.

Dominant language
Java
Stars
3
Forks
2
Avg merge
9h 19m
Merged PRs (30d)
154

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dfa1/vortex-java

All issues in dfa1/vortex-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.