Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

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 <aaron.d@nylas.com>
@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 (1aba5c8) to head (5ead7ef).

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.

@devin-ai-integration
Copy link
Contributor 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 <aaron.d@nylas.com>
@AaronDDM AaronDDM merged commit 4bbef53 into main Jan 18, 2025
3 checks passed
@AaronDDM AaronDDM mentioned this pull request Jan 24, 2025
AaronDDM added a commit that referenced this pull request Jan 24, 2025
# Changelog
* Made `NylasClient` and its methods open to enable mocking in tests
(#258).
* Added pagination support for folders
(#259).
* Fixed issue where reminders were not being updated correctly when
updating an event (#261).

# License
<!-- Your PR comment must contain the following line for us to merge the
PR. -->
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
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!

3 participants