Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make NylasClient and its methods open for mocking #258

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link

Make NylasClient and its methods open for mocking

This PR makes the NylasClient class and its methods open to enable mocking in tests, addressing issue #257.

Changes

  • Added open modifier to NylasClient class
  • Made all resource accessor methods (messages, calendars, etc.) open
  • Made HTTP execution methods open for comprehensive mocking support

Testing

These changes are purely related to class and method modifiers to enable mocking. The changes do not affect runtime behavior and maintain all existing functionality. The modifications only impact compile-time characteristics to allow for better testing capabilities.

Notes

  • This change is backward compatible
  • No runtime behavior changes
  • Enables better testing capabilities for SDK users

Fixes #257

Link to Devin run: https://app.devin.ai/sessions/f6b8eb21945e4b84a4b26f39136760cd

This change makes the NylasClient class and its methods open to enable mocking in tests.
- Added open modifier to NylasClient class
- Made all resource accessor methods (messages, calendars, etc.) open
- Made HTTP execution methods open for comprehensive mocking support

Fixes #257

Co-Authored-By: Aaron de Mello <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.28%. Comparing base (4be4cad) to head (4394b6c).

Files with missing lines Patch % Lines
src/main/kotlin/com/nylas/NylasClient.kt 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main     #258   +/-   ##
=========================================
  Coverage     81.28%   81.28%           
  Complexity      316      316           
=========================================
  Files            35       35           
  Lines           967      967           
  Branches         88       88           
=========================================
  Hits            786      786           
  Misses          129      129           
  Partials         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Add "(aside)" to your comment to have me ignore it.

Added entry under Unreleased section for making NylasClient and its methods open to enable mocking in tests.

Co-Authored-By: Aaron de Mello <[email protected]>
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.

Make NylasClient open instead of final so we can mock it!
2 participants