Skip to content

CAMEL-23274: Fix SonarCloud critical bugs in test code#22478

Merged
gnodet merged 1 commit intoapache:mainfrom
gnodet:CAMEL-23274-fix-critical-bugs
Apr 8, 2026
Merged

CAMEL-23274: Fix SonarCloud critical bugs in test code#22478
gnodet merged 1 commit intoapache:mainfrom
gnodet:CAMEL-23274-fix-critical-bugs

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Apr 8, 2026

CAMEL-23274

Fix two critical SonarCloud bugs reported on the main branch:

  1. ModelParserTest.java (S5783): Extract ModelParser construction out of the assertThrows lambda so that only parseRoutesDefinition() is the throwing call. Previously both the constructor and the method could throw the same checked exception, making it ambiguous which call caused the exception.

  2. EnvironmentHelperTest.java (S5845): Replace assertNotNull(result) with assertDoesNotThrow(...) for three tests where result is a primitive boolean. Comparing a primitive with null via assertNotNull is always true due to autoboxing and does not test anything meaningful.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet requested review from christophd and davsclaus April 8, 2026 04:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet merged commit d0019ea into apache:main Apr 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants