Skip to content

Simplify AssertJ assertions flagged by Sonar (java:S5838) #736

Open

Description

@dfa1

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions