Skip to content

test: improve coverage for MatchStrategy#295

Merged
RoiSoleil merged 2 commits into
masterfrom
test/improve-coverage-match-strategy-12947141865639600907
May 24, 2026
Merged

test: improve coverage for MatchStrategy#295
RoiSoleil merged 2 commits into
masterfrom
test/improve-coverage-match-strategy-12947141865639600907

Conversation

@RoiSoleil
Copy link
Copy Markdown
Contributor

Improves the automated test coverage for MatchStrategy.java within the org.moreunit.core module.

Summary of improvements:

  • Tested classes: org.moreunit.core.matching.MatchStrategy
  • Newly covered branches: Validates the searchIsOver branching logic within the anonymous FileMatchCollector subclasses spawned by both ALL_MATCHES and ANY_MATCH enum values.
  • Edge cases added: Confirms that ALL_MATCHES never marks the search as over, and that ANY_MATCH safely transitions its searchIsOver state strictly after acceptFile successfully executes and discovers a match.
  • Rationale for mocking choices: Used lightweight Mockito stubs (mock(IFile.class), mock(SourceFolderPath.class)) instead of full Eclipse Workspace PDE dependencies. This keeps the tests blazing fast, non-fragile, isolated, and perfectly capable of running inside OSGi headless CI environments.
  • Limitations: N/A - standard JUnit and Mockito was sufficient. No Eclipse runtime startup was needed.

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

This commit adds a new unit test suite, `MatchStrategyTest`, to explicitly
verify the behavior of the `FileMatchCollector` instances produced by
`MatchStrategy.ALL_MATCHES` and `MatchStrategy.ANY_MATCH`. It tests their
core branch logic regarding the termination condition (`searchIsOver()`).
These tests strictly utilize standard JUnit 4 APIs and Mockito for dependency
isolation, and maintain full compatibility with the existing test infrastructure.

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.

This commit adds a new unit test suite, `MatchStrategyTest`, to explicitly
verify the behavior of the `FileMatchCollector` instances produced by
`MatchStrategy.ALL_MATCHES` and `MatchStrategy.ANY_MATCH`. It tests their
core branch logic regarding the termination condition (`searchIsOver()`)
by invoking `acceptFile()` and verifying the boolean return values and the
size of the collected results. These tests strictly utilize standard JUnit 4
APIs and lightweight Mockito stubs for dependency isolation.

Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.75%. Comparing base (c45130b) to head (a65dcc3).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #295      +/-   ##
============================================
+ Coverage     75.67%   75.75%   +0.07%     
- Complexity     3378     3382       +4     
============================================
  Files           428      429       +1     
  Lines         14827    14847      +20     
  Branches       1288     1288              
============================================
+ Hits          11221    11247      +26     
+ Misses         3068     3063       -5     
+ Partials        538      537       -1     

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

@RoiSoleil RoiSoleil merged commit 6231dac into master May 24, 2026
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