Skip to content

Conversation

@LI123456mo
Copy link
Contributor

This PR adds unit test coverage for the ToStringUtils utility class to ensure robust object-to-string conversion.

Key Coverage:

Null Safety: Verified that both printToString and toString return "null" without crashing.

Collection Handling: Tested formatted output for Arrays, Lists, and Maps, ensuring correct use of brackets, braces, and delimiters.

Recursion: Confirmed that nested collections (e.g., a List inside a Map) are correctly unwrapped and formatted.

Simple Types: Ensured primitives and basic types (String, Integer, Boolean) return their expected string values.

Verification: Successfully ran mvn clean test -Dtest=ToStringUtilsTest -pl dubbo-common with green results.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.77%. Comparing base (a92d5d0) to head (29ad886).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16032      +/-   ##
============================================
+ Coverage     60.75%   60.77%   +0.02%     
- Complexity    11736    11738       +2     
============================================
  Files          1949     1949              
  Lines         88801    88801              
  Branches      13391    13391              
============================================
+ Hits          53952    53972      +20     
+ Misses        29314    29289      -25     
- Partials       5535     5540       +5     
Flag Coverage Δ
integration-tests-java21 32.22% <ø> (+<0.01%) ⬆️
integration-tests-java8 32.34% <ø> (-0.01%) ⬇️
samples-tests-java21 32.24% <ø> (+0.12%) ⬆️
samples-tests-java8 29.67% <ø> (-0.05%) ⬇️
unit-tests-java11 59.07% <ø> (+0.03%) ⬆️
unit-tests-java17 58.53% <ø> (+0.01%) ⬆️
unit-tests-java21 58.52% <ø> (+<0.01%) ⬆️
unit-tests-java25 58.49% <ø> (+<0.01%) ⬆️
unit-tests-java8 59.06% <ø> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

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.

2 participants