Skip to content

test: assert expected exceptions in 5 core tests - #8323

Open
sharanggupta wants to merge 2 commits into
apache:2.xfrom
sharanggupta:core-tests-assert-throws
Open

sharanggupta wants to merge 2 commits into
apache:2.xfrom
sharanggupta:core-tests-assert-throws

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR did

Five tests in MessageFutureTest, ChannelManagerTest and DefaultServerMessageListenerImplTest checked the exception only in a catch block, so they passed when nothing was thrown. They now use assertThrows and then check the message.

Ⅱ. Does this pull request fix one issue?

No.

Ⅲ. Why don't you add test cases (unit test/integration test)?

This PR fixes existing tests.

Ⅳ. Describe how to verify it

./mvnw -pl core -am test -Dtest=MessageFutureTest,ChannelManagerTest,DefaultServerMessageListenerImplTest -Dsurefire.failIfNoSpecifiedTests=false passes (71 tests). If MessageFuture.get, ChannelManager.getChannel or getServerMessageSender stop throwing, the old tests still pass and the new ones fail.

Five tests in MessageFutureTest, ChannelManagerTest and
DefaultServerMessageListenerImplTest checked the exception only in a
catch block, so they passed when nothing was thrown.
@github-actions github-actions Bot added the type: test test case label Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.90%. Comparing base (cba73e1) to head (ccbf476).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #8323      +/-   ##
============================================
+ Coverage     79.84%   79.90%   +0.06%     
+ Complexity     1162     1160       -2     
============================================
  Files          1400     1400              
  Lines         53011    53011              
  Branches       6349     6349              
============================================
+ Hits          42325    42358      +33     
+ Misses         7729     7706      -23     
+ Partials       2957     2947      -10     

see 12 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

type: test test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant