test: improve coverage for MatchStrategy#295
Conversation
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>
|
👋 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 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Improves the automated test coverage for
MatchStrategy.javawithin theorg.moreunit.coremodule.Summary of improvements:
org.moreunit.core.matching.MatchStrategysearchIsOverbranching logic within the anonymousFileMatchCollectorsubclasses spawned by bothALL_MATCHESandANY_MATCHenum values.ALL_MATCHESnever marks the search as over, and thatANY_MATCHsafely transitions itssearchIsOverstate strictly afteracceptFilesuccessfully executes and discovers a match.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.PR created automatically by Jules for task 12947141865639600907 started by @RoiSoleil