-
Notifications
You must be signed in to change notification settings - Fork 28
Fix subscription keys for Spring client #231
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,36 +1,83 @@ | ||||
| package nostr.api.unit; | ||||
|
|
||||
| import nostr.api.NostrIF; | ||||
| import nostr.api.NostrSpringWebSocketClient; | ||||
| import nostr.id.Identity; | ||||
| import org.junit.jupiter.api.BeforeEach; | ||||
| import nostr.api.WebSocketClientHandler; | ||||
| import org.junit.jupiter.api.Test; | ||||
|
|
||||
| import java.lang.reflect.Field; | ||||
| import java.lang.reflect.Method; | ||||
| import java.util.Map; | ||||
| import java.util.concurrent.ConcurrentHashMap; | ||||
|
|
||||
| import static org.junit.jupiter.api.Assertions.assertSame; | ||||
| import sun.misc.Unsafe; | ||||
|
|
||||
|
Comment on lines
+12
to
+13
|
||||
| import sun.misc.Unsafe; |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The createHandler method contains complex reflection logic that could be simplified. Consider using a builder pattern or factory method that doesn't require manual field manipulation, making the test more maintainable and less brittle to implementation changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using a magic string ":" for filtering could be error-prone. Consider defining a constant like
SUBSCRIPTION_SEPARATORto make the code more maintainable and self-documenting.