Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
=======================================
Coverage 80.64% 80.64%
=======================================
Files 51 51
Lines 966 966
Branches 92 92
=======================================
Hits 779 779
Misses 160 160
Partials 27 27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR converts the NatsJwt class into a static class to simplify its usage by removing the need for instantiation. Key changes include refactoring tests to call static methods, updating PublicAPI definitions, and modifying the NatsJwt implementation accordingly.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/NATS.Jwt.Tests/ValidationTests.cs | Removed instance creation and updated method calls to the static NatsJwt API. |
| tests/NATS.Jwt.Tests/NatsJwtTests.cs | Updated all tests to reference static methods instead of instance methods. |
| tests/NATS.Jwt.Tests/ConnectTests.cs | Refactored JWT generation tests to use the new static method calls. |
| tests/NATS.Jwt.TestNativeAot/Program.cs | Converted instance usage to static calls in the native AOT test sample. |
| src/NATS.Jwt/PublicAPI.Unshipped.txt | Updated public API documentation to reflect the change from instance methods to static methods. |
| src/NATS.Jwt/NatsJwt.cs | Converted the NatsJwt class and all its methods to static, removing the need to instantiate the class. |
Comments suppressed due to low confidence (2)
src/NATS.Jwt/NatsJwt.cs:23
- Ensure that converting NatsJwt into a static class does not inadvertently remove any required state management or configuration capability that was previously embedded in instance behavior.
public static class NatsJwt
src/NATS.Jwt/PublicAPI.Unshipped.txt:386
- Update the public API documentation and release notes to clearly indicate that the NatsJwt APIs are now static, and that instance methods have been removed as part of this breaking change.
NATS.Jwt.Models.TimeRange.Start.set -> void
mtmk
left a comment
There was a problem hiding this comment.
LGTM thanks @rickdotnet it makes sense. iirc there was a suggestion for static before as well
As noted in #42, NatsJwt could provide simpler access if made static. I'm currently reusing a singleton instance, but making it static would eliminate the need for this
Unless there are reasons against it, this PR marks NatsJwt as static.