Skip to content

fix: #85 | Resolve the warnings in the TryTest class#113

Merged
ShivamNagpal merged 1 commit intodevelopfrom
minor-fixes
Mar 29, 2026
Merged

fix: #85 | Resolve the warnings in the TryTest class#113
ShivamNagpal merged 1 commit intodevelopfrom
minor-fixes

Conversation

@ShivamNagpal
Copy link
Copy Markdown
Contributor

@ShivamNagpal ShivamNagpal commented Mar 29, 2026

Summary by CodeRabbit

  • Tests
    • Improved test reliability by removing unnecessary compiler warning suppressions.
    • Enhanced test structure for better assertion handling in concurrent scenarios.
    • Refactored test invocations for improved code consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84b84611-0675-49dd-87dc-5563f9b6ff69

📥 Commits

Reviewing files that changed from the base of the PR and between 7959b57 and b15d878.

📒 Files selected for processing (1)
  • src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java

📝 Walkthrough

Walkthrough

This PR refactors unit tests for the Try class by removing @SuppressWarnings annotations, replacing lambda expressions with method references in test invocations, and restructuring InterruptedException-handling tests to use try-finally blocks for proper thread interrupt state cleanup.

Changes

Cohort / File(s) Summary
Try Test Cleanup
src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java
Removed @SuppressWarnings annotations for DataFlowIssue and unchecked warnings; replaced lambda allocations with method references in Try.withResources and Try.consumeResource test invocations; refactored three InterruptedException test cases (Try.run, Try.withResources, Try.consumeResource) to wrap assertions in try-finally blocks instead of calling Thread.interrupted() at test end.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #111: Introduces Try.run, Try.withResources, and Try.consumeResource APIs that are directly exercised and tested by the refactored unit tests in this PR.

Poem

🐰 With warnings gone and references clean,
Try tests now shine brighter than ever seen,
Thread interrupts wrapped in finally's care,
A tidy test suite, beyond compare! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: removing warnings from the TryTest class and resolving issue #85. It is concise, specific, and clearly conveys the primary purpose of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch minor-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ShivamNagpal ShivamNagpal requested a review from Copilot March 29, 2026 06:32
@ShivamNagpal
Copy link
Copy Markdown
Contributor Author

@codex review

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #85 by cleaning up warnings in TryTest, focusing on removing redundant suppressions and making interrupt-related tests safer by ensuring thread interrupt state is cleared after assertions.

Changes:

  • Removed several redundant @SuppressWarnings annotations in TryTest.
  • Wrapped InterruptedException-related tests in try/finally blocks to ensure the interrupt flag is cleared after the test.
  • Replaced some resource supplier lambdas with TestResource::new method references.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java
Comment thread src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java
Comment thread src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java
Comment thread src/test/java/org/zeplinko/commons/lang/ext/core/TryTest.java
@ShivamNagpal ShivamNagpal merged commit 7d2f48f into develop Mar 29, 2026
7 checks passed
@ShivamNagpal ShivamNagpal deleted the minor-fixes branch March 29, 2026 06:37
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.

3 participants