SONARJAVA-6406 Fix Quality Gate#5656
Conversation
a46ae7a to
4a86e83
Compare
tomasz-tylenda-sonarsource
left a comment
There was a problem hiding this comment.
We discussed changing assertThatCode -> assertThrownBy
…ThatThrownBy instead of assertThatCode when it applies
4a86e83 to
21926c0
Compare
|
Code Review ✅ Approved 6 resolved / 6 findingsRefactors test assertions to use standard AssertJ patterns, addressing brittle error counts and redundant message shadowing. Cleaned up wildcard imports and contradictory fail messages across multiple test suites. ✅ 6 resolved✅ Bug: Brittle magic number: error-log count changed from 1 to 12
✅ Quality: Wildcard static import contradicts Quality Gate intent
✅ Quality: Contradictory fail message on doesNotThrowAnyException assertion
✅ Quality: withFailMessage masks the real assertion mismatch detail
✅ Quality: withFailMessage masks the real exception/assertion detail
...and 1 more resolved from earlier reviews OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |





Summary by Gitar
java-checks-testkit,java-frontend, andsonar-java-pluginto use AssertJassertThatCodeandassertThatThrownByinstead of manualtry-catchblocks andfail()calls.try-catchand redundant message shadowing.Fail.failand JUnitfailimports, replacing them with standard AssertJ static imports.This will update automatically on new commits.