Skip to content

test: refactor MergeSortedArrayListTest using JUnit 5 parameterized tests#7445

Merged
DenizAltunkapan merged 5 commits into
TheAlgorithms:masterfrom
sawaleparas:feat/upgrade-merge-sorted-arraylist-test
Jun 3, 2026
Merged

test: refactor MergeSortedArrayListTest using JUnit 5 parameterized tests#7445
DenizAltunkapan merged 5 commits into
TheAlgorithms:masterfrom
sawaleparas:feat/upgrade-merge-sorted-arraylist-test

Conversation

@sawaleparas
Copy link
Copy Markdown
Contributor

Description

This PR upgrades the existing MergeSortedArrayListTest by refactoring individual test scenarios into a unified, data-driven @ParameterizedTest.

Changes Implemented

  • Consolidated multiple standard and edge-case testing loops into a clean, parameterized scenario method using @MethodSource.
  • Split up the multi-assertion NullPointerException test into separate, dedicated validation methods (testMergeThrowsExceptionWhenListAIsNull, etc.) for sharper failure isolation.
  • Maintained clean imports and adhered strictly to the repository's naming conventions (testMergeParameterizedScenarios).

Verification Results

All 9 test cases passed successfully locally inside IntelliJ IDEA with zero regressions.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.69%. Comparing base (978a306) to head (55b169a).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7445      +/-   ##
============================================
- Coverage     79.70%   79.69%   -0.02%     
+ Complexity     7275     7272       -3     
============================================
  Files           802      802              
  Lines         23700    23700              
  Branches       4661     4661              
============================================
- Hits          18891    18888       -3     
  Misses         4055     4055              
- Partials        754      757       +3     

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

@DenizAltunkapan DenizAltunkapan merged commit 5feaba6 into TheAlgorithms:master Jun 3, 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.

4 participants