Skip to content

test: improve coverage for core.util classes - #348

Merged
RoiSoleil merged 1 commit into
masterfrom
test/coverage-core-util-12283811644484274572
Jul 16, 2026
Merged

test: improve coverage for core.util classes#348
RoiSoleil merged 1 commit into
masterfrom
test/coverage-core-util-12283811644484274572

Conversation

@RoiSoleil

Copy link
Copy Markdown
Contributor

This PR improves test coverage for the org.moreunit.core.util package by adding unit tests for utility classes that were previously lacking coverage.

Changes Included:

  • Added LRUCacheTest to verify correct LRU eviction behavior (when entries exceed maxSize, the eldest is removed and MRU status is properly tracked).
  • Added StringLengthComparatorTest to verify that strings are compared properly based on their length, covering scenarios with shorter vs longer, longer vs shorter, and equal length strings.
  • Added ObjectsTest to assert behavior of utility methods equal() and hash(), including safe null handling, equal values, and hashcode generation for multiple objects.
  • Added FeaturesTest to ensure feature toggle configurations based on system properties resolve correctly (true, false, default).

Validation:

  • Tested classes: LRUCache, StringLengthComparator, Objects, Features.
  • Covered edge cases such as null-safety (e.g. Objects.equal(null, null)), eldest eviction order when fetching cached elements, and default system property evaluation.
  • Executed Maven xvfb-run -a mvn -f org.moreunit.build/pom.xml test build successfully locally with all tests passing and no regressions introduced. No mocking was required since all logic involves pure unit logic.

PR created automatically by Jules for task 12283811644484274572 started by @RoiSoleil

Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.66%. Comparing base (9145344) to head (7081005).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #348      +/-   ##
============================================
- Coverage     79.74%   79.66%   -0.08%     
+ Complexity     4058     4042      -16     
============================================
  Files           517      513       -4     
  Lines         17347    17288      -59     
  Branches       1339     1339              
============================================
- Hits          13833    13773      -60     
- Misses         2946     2947       +1     
  Partials        568      568              

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

@RoiSoleil
RoiSoleil merged commit fe5579f into master Jul 16, 2026
6 of 7 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.

1 participant