Skip to content

Issue #19176: migrate metrics tests to getExpectedThrowable#19215

Merged
romani merged 1 commit into
checkstyle:masterfrom
achyuth8055:issue-19176-metrics-migration
Mar 15, 2026
Merged

Issue #19176: migrate metrics tests to getExpectedThrowable#19215
romani merged 1 commit into
checkstyle:masterfrom
achyuth8055:issue-19176-metrics-migration

Conversation

@achyuth8055

Copy link
Copy Markdown
Contributor

Issue #19176: migrate coding tests to getExpectedThrowable

Migrated 3 test files in the checks/metrics package from the old
assertWithMessage(...).fail() try-catch pattern to the new
getExpectedThrowable utility method.

Files migrated:

  • BooleanExpressionComplexityCheckTest.java (1 try-catch)
  • ClassFanOutComplexityCheckTest.java (1 try-catch)
  • ClassDataAbstractionCouplingCheckTest.java (2 try-catches)

Also updated config/suppressions.xml to add checks/metrics to the
MatchXpathForbidTryCatchFail exclusion regex, and removed redundant
throws Exception from methods that no longer throw checked exceptions.

Resolves #19176
Screenshot 2026-03-13 at 3 24 23 AM

Copilot AI review requested due to automatic review settings March 13, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@romani

romani commented Mar 13, 2026

Copy link
Copy Markdown
Member

conflict

@achyuth8055 achyuth8055 force-pushed the issue-19176-metrics-migration branch from af70ed1 to 5d2c05c Compare March 15, 2026 01:43

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thasks a lot

@romani romani merged commit ac90549 into checkstyle:master Mar 15, 2026
118 of 123 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.

Migrate remaining test files to use getExpectedThrowable instead of fail()

3 participants