Skip to content

test(reader): use more specific AssertJ assertions (java:S5838) (#736) - #757

Merged
dfa1 merged 3 commits into
dfa1:mainfrom
Contributerr27:test/reader-sonar-s5838
Nov 24, 2026
Merged

dfa1 merged 3 commits into
dfa1:mainfrom
Contributerr27:test/reader-sonar-s5838

Conversation

@Contributerr27

Copy link
Copy Markdown
Contributor

What and why

Refs #736 - covers the reader module's 17 SonarCloud findings (java:S5838), as claimed on the issue:

  • compute/ComputeTest.java (12): assertThat(result.get(k)).isEqualTo(v) becomes assertThat(result).containsEntry(k, v), including the null-key cases (the map is a HashMap, so null keys are fine).
  • compute/DictFilterTest.java (2) and ComputeFilteredAggregateTest.java (3): additive-identity checks become isZero(). One wrinkle: these targets are typed Number, and AssertJ has no assertThat(Number) overload, so isZero() doesn't exist on the resulting ObjectAssert. The rewrite is assertThat(x.longValue()).isZero(), which keeps the same pass/fail on the pinned long data.

Test-only, behavior-neutral, // Given / // When / // Then structure kept. writer (3), fsst, calcite and integration (1 each) are left for anyone else who wants them.

Checklist

  • ./mvnw test -pl reader -am green locally on JDK 25: 2530 tests, 0 failures, 0 errors.
  • Commits authored as Contributerr27; branch off main, no merge commits.

…#736)

Test-only, behavior-neutral; Given/When/Then structure kept.
…#736)

Test-only, behavior-neutral; Given/When/Then structure kept.
…#736)

Test-only, behavior-neutral; Given/When/Then structure kept.
@dfa1

dfa1 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

thanks for your contribution!

@dfa1
dfa1 merged commit b580aaa into dfa1:main Nov 24, 2026
5 of 6 checks passed
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