Skip to content

Simplify MockClusterInvoker fail mock tests#16327

Closed
gaoxiaolei-s59 wants to merge 1 commit into
apache:3.3from
gaoxiaolei-s59:codex/simplify-mock-cluster-invoker-test
Closed

Simplify MockClusterInvoker fail mock tests#16327
gaoxiaolei-s59 wants to merge 1 commit into
apache:3.3from
gaoxiaolei-s59:codex/simplify-mock-cluster-invoker-test

Conversation

@gaoxiaolei-s59

Copy link
Copy Markdown

What

This PR simplifies MockClusterInvokerTest.testMockInvokerFromOverride_Invoke_Fock_WithOutDefault by splitting the configured mock assertions and the unconfigured mock exception path into separate test cases.

It also replaces the empty try/catch plus Assertions.fail() pattern with Assertions.assertThrows, making the expected RpcException explicit.

Why

Keeping each test focused makes failures easier to diagnose and addresses the readability improvement requested in #10486.

Closes #10486.

Verification

  • ./mvnw -pl dubbo-cluster -Dtest=MockClusterInvokerTest test
  • ./mvnw -pl dubbo-cluster test

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.47%. Comparing base (c3ceb27) to head (101b61c).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16327      +/-   ##
============================================
- Coverage     60.79%   60.47%   -0.32%     
+ Complexity    11777    10261    -1516     
============================================
  Files          1953     1953              
  Lines         89208    89208              
  Branches      13458    13458              
============================================
- Hits          54234    53952     -282     
- Misses        29403    29643     +240     
- Partials       5571     5613      +42     
Flag Coverage Δ
integration-tests-java21 ?
integration-tests-java8 ?
samples-tests-java21 32.24% <ø> (+0.11%) ⬆️
samples-tests-java8 29.87% <ø> (+0.01%) ⬆️
unit-tests-java11 59.08% <ø> (+0.05%) ⬆️
unit-tests-java17 58.56% <ø> (+0.04%) ⬆️
unit-tests-java21 58.54% <ø> (+0.03%) ⬆️
unit-tests-java25 58.50% <ø> (+0.02%) ⬆️
unit-tests-java8 59.06% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@gaoxiaolei-s59 gaoxiaolei-s59 marked this pull request as ready for review June 10, 2026 06:53
@gaoxiaolei-s59

Copy link
Copy Markdown
Author

Superseded by #16328 after recreating the pull request due to repeated unrelated integration CI failures.

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.

Simplify MockClusterInvokerTest.testMockInvokerFromOverride_Invoke_Fock_WithOutDefault() to improve the Readability

2 participants